星空网 > 软件开发 > Java

Unity3D之2D文理Moive文理使用

#pragma strict

private var oneTexture:Texture2D;
private var allTexture:Object[];

function OnGUI()
{
if(GUI.Button(Rect(0,20,100,60),"loadOneTexture"))
{
if(oneTexture==null)
{
oneTexture=Resources.Load("oneTexture/Grass");
}
}
if(GUI.Button(Rect(0,140,100,60),"loadAllTexture"))
{
if(allTexture==null)
{
allTexture=Resources.LoadAll("allTextere");
}
}

if(oneTexture!=null)
{
GUI.DrawTexture(Rect(0,20,120,120),oneTexture,ScaleMode.StretchToFill,true,0);
}

if(allTexture!=null)
{
for(var i=0;i<allTexture.Length;i++)
{
GUI.DrawTexture(Rect(0+i*20,120,120,120),allTexture[i],ScaleMode.StretchToFill,true,0);
}
}
}




原标题:Unity3D之2D文理Moive文理使用

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流