|
[code=csharp]
//动态加载图片
IEnumerator loadImage()
{
WWW www = new WWW("http://u3dchina.com/template/singcere_dw/common/images/logo.png");
yield return www;
txt2d = new Texture2D(4, 4, TextureFormat.DXT1, false);
www.LoadImageIntoTexture(txt2d);//Resources.LoadAssetAtPath("http://u3dchina.com/template/singcere_dw/common/images/logo.png", typeof(Texture)) as Texture;
GameObject.Find("Game1BG").GetComponent<UITexture>().mainTexture = txt2d;
}
[/code]
|
|