小白求教Resources.Load()
#pragma strict
private var texsingle:Texture2D;
private var texall:Object[];
function Start () {
}
function OnGUi(){
if(GUI.Button(Rect(0,10,512,256),"加载一张贴图")){
if(texsingle == null){
texsingle = Resources.Load("single/1");
}
}
if(GUI.Button(Rect(0,130,512,256),"加载一组贴图")){
if(texall == null){
texall = Resources.LoadAll("texture");
}
}
if(texsingle!=null){
GUI.DrawTexture(Rect(110,10,512,256),texsingle,ScaleMode.StretchToFill,true,0);
}
if(texall != null){
for(var i=0;i<texall.Length;i++){
GUI.DrawTexture(Rect(110+i*120,130,512,256),texall[i],ScaleMode.StretchToFill,true,0);
}
}
}
function Update () {
}
为什么这个图片加载不进去?是不是有什么图片大小的限制,我觉得代码也没错....小白求教