从网络中读取图片赋予到UITextrue
配置图如下:WWW www = new WWW("http://u3dchina.com/template/singcere_dw/common/images/logo.png");
yield return www;
txt2d = new Texture2D(4, 4, TextureFormat.ARGB32, 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; //设置读取图片
GameObject.Find("Game1BG").name = "Game1BG" + j.ToString();
WWW www1 = new WWW(jd["GameData"]["PictureURL"].ToString());
print(jd["GameData"]["PictureURL"].ToString());
yield return www1;
Texture2D txt2d = new Texture2D(4, 4, TextureFormat.ARGB32, false);
www1.LoadImageIntoTexture(txt2d);
item.GetComponentInChildren<UITexture>().material.mainTexture = txt2d;
//读取图片结束
本帖最后由 玉生 于 2013-5-31 14:41 编辑
readma 发表于 2013-4-18 16:26 static/image/common/back.gif
这里面的yield是什么意思呢
学习下协程的知识 谢谢。学到东西了~ 好 不错的 很不错 楼主是超人 真心顶 难得一见的好帖
页:
[1]