赞
踩
用代码实现加载图片
点击按钮可以将图片显示出来
- private var texSingle:Texture2D;
- function OnGUI()
- {
- if(GUI.Button(Rect(0,10,100,50),"add"))
- {
- if(texSingle == null)
- {
- texSingle = Resources.Load("psb27");
- }
- }
-
- if(texSingle != null)
- {
- GUI.DrawTexture(Rect(110,10,120,120),texSingle,ScaleMode.StretchToFill,true,0);
-
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。