Unity3D 窗口GUI.Window(2) 用 javaScript





var mySkin:GUISkin;
private var choose : boolean = false;
var windowRect : Rect = Rect(20,20,120,50);


function OnGUI()
{
	GUI.skin = mySkin;
	GUI.Button(Rect(100,100,100,100),"CustomButton");
	choose = GUI.Toggle(Rect(10,50,100,30),choose,"Signle");
	windowRect = GUI.Window (0, windowRect, setWindow, "这是一个窗口");
}

//创建窗口内容
function setWindow (windowID : int) 
{
	//创建一个可以自由拖动的窗口
	GUI.DragWindow ();	
		//绘制自定义按钮
	GUI.Button(Rect (10,20,100,30),"自定义按钮");
}


你可能感兴趣的:(函数,boolean)