星空网 > 软件开发 > ASP.net

Unty3D动态加载图片

试验动态加载图片,代码如下:

using UnityEngine;using System.Collections;public class DynamicLoad : MonoBehaviour{  Texture2D txt;  IEnumerator Start()  {    string path = Application.dataPath + "/Title000.png";    WWW www = new WWW("file://" + path);    yield return www;        txt = new Texture2D(200,200);    txt = www.texture; // 方式一    //www.LoadImageIntoTexture(txt); // 方式二  }  void OnGUI()  {    if (txt != null)    {      GUI.DrawTexture(new Rect(0, 0, 200, 200), txt);    }  }}

 




原标题:Unty3D动态加载图片

关键词:图片

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流