using UnityEngine;
using System.Collections;
public class CreateTexture : MonoBehaviour
{
// Use this for initialization
void Start ()
{
UITexture uiTexture = NGUITools.AddWidget<UITexture>(gameObject);
int depth = NGUITools.CalculateNextDepth(gameObject);
uiTexture.depth = depth;
Texture texure = Resources.Load<Texture>("Textures/test");//加载Resources/Textures/test.png
uiTexture.mainTexture = texure;
}
// Update is called once per frame
void Update ()
{
}
}
NGUI动态加载图片创建Texture
最新推荐文章于 2017-12-17 17:30:00 发布