Unity3D 使用脚本来控制 UI 的 Image 显示的图片。

记录一下这个问题。

原文地址:http://tieba.baidu.com/p/3561719701

 

object obj = Resources.Load(资源名, typeof(Sprite));
Sprite sp = obj as Sprite;
img.sprite = sp;

 

posted @ 2015-05-07 07:55  cjnmy36723  阅读(1518)  评论(0编辑  收藏  举报