#pragma strict
var winRect:Rect=Rect(30,100,150,200);
var windowShow:boolean=true;
function OnGUI () {
windowShow=GUI.Toggle(Rect(10,10,100,20),windowShow,"窗口显示");
if(windowShow)
//参数:windowID,位置,回调函数,名称,样式……
winRect=GUI.Window(0,winRect,windowFun,"测试窗口");
}
function windowFun()
{
if(GUI.Button(Rect(20,20,100,50),"窗口内部按钮"))
print("窗口内部按钮被单击");
//窗口拖动,指定拖动范围
GUI.DragWindow(Rect(0,0,2000,2000));
}