[code=javascript]
var enabled : boolean;
var Skin:GUISkin;
var showWindow = false;
function OnGUI(){
GUI.skin=Skin;
GUI.Box (Rect (150,20,Screen.width/1.5,Screen.height/20),"");
if(GUI.Button (Rect (155,20,Screen.width/(1.5*5),Screen.height/20), "摆设柜子"))
{
showWindow = true;
}
if(showWindow )
var rec=Rect(160,24+Screen.height/20,Screen.width/2,Screen.height/20);
rec = GUI.Window (0, rec, MyWindow,"详细柜子清单");
rec = GUI.Window (0, rec, MyWindow,"详细柜子清单");
if(showWindow==false){
return;}
else if(GUI.Button(Rect(120+Screen.width/2,24+Screen.height/20,40,25),"关闭"))
{
showWindow=false;
Application.Quit();
}
else if(GUI.Button (Rect (160,24+Screen.height/20,Screen.width/(2*5),Screen.height/25), "物品柜子一"))
{
VisibleOrNot();
}
}
function MyWindow(windowID : int)
{
}
function VisibleOrNot(){
if(!renderer.enabled){
renderer.enabled = true;
}
else{
renderer.enabled = false;
}
}
GUI要加入中文字体
[/code] |