I think Unity does not supports running multiple GUI.Windows.
I tried this but, it only displays the 2nd Window “Window2()” Instead of both windows. Does anyone knows how to run a multiple GUI.Windows at the same time?
Window1();
Window2();
function Awake(){
}
function Update(){
}
function OnGUI(){
Window1();
Window2();
}
function Window1(){
return GUI.Window (0, EditWindowRect(), EditWindowFunction, "My Window");
}
function EditWindowRect(){
return Rect (0,0,140, 280);
}
function EditWindowFunction(){
//Display GUI Buttons
if(GUI.Button(Rect(20,30,100,30),"Cube")){
}
else if(GUI.Button(Rect(20,80,100,30),"Sphere")){
}
else if (GUI.Button(Rect(20,130,100,30),"Custom Object")){
}
else if (GUI.Button(Rect(20,180,100,30),"Rotate Object")){
}
else if (GUI.Button(Rect(20,230,100,30),"Stop Rotate Object")){
}
}
function Window2(){
GUI.Window (0, DisplayMyTexturesWindowRect(), DisplayMyTexturesWindowFunction, "Texture Window");
//GUI.Box(Rect(180,Screen.height*0.1,100,50), GUIContent(myImage));
}
function DisplayMyTexturesWindowRect(){
return Rect (500,0,280, 140);
}
function DisplayMyTexturesWindowFunction(){
if(GUI.Button(Rect(20,30,100,30),"Finish")){
}
}