标签:style blog class code c java
获取GUITexture
GameObject _obj = GameObject.Find("Tex1"); GUITexture _tex = _obj.GetComponent<GUITexture>();
加载图片字节流
//读取文件到byte数组 byte[] bytes = System.IO.File.ReadAllBytes(@"Assets\MapTex_1\gs_0_74_8.jpg"; Texture2D _tex2D = new Texture2D(256,256); _tex2D.LoadImage(bytes);
替换texture
_tex.texture = _tex2D;
标签:style blog class code c java
原文地址:http://www.cnblogs.com/felove2013/p/3730157.html