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(,);
txt = www.texture; // 方式一
//www.LoadImageIntoTexture(txt); // 方式二 } void OnGUI()
{
if (txt != null)
{
GUI.DrawTexture(new Rect(, , , ), txt);
}
}
}
上一篇:http://backboneconf.com/ @前端 真好


下一篇:vue中输入框聚焦,自动跳转下一个输入框