Add Dynamic Texture2D

Dynamic Texture2D in UnityUI

Create Texture2D and assign image to it through a script

//需要在最上级Asset folder下建一个Resources folder,然后里面放要dynamic attach的texture

using
UnityEngine; using System.Collections; public class TearApartControl : MonoBehaviour { public Texture2D handCursor; // Use this for initialization void Start () { { handCursor = (Texture2D)Resources.Load("HandIcon"); } } }

 

posted @ 2013-01-29 06:48  若愚Shawn  阅读(278)  评论(0编辑  收藏  举报