|
[code=javascript]
var iFocus=0;
function OnGUI()
{GUI.SetNextControlName("tFXXX");
GUI.TextField(Rect(10,10,100,20),"XXX");
GUI.SetNextControlName("tFYYY");
GUI.TextField(Rect(10,40,100,20),"YYY");
GUI.SetNextControlName("tFLogin");
GUI.Button(new Rect(120,10,50,20),"Login");
GUI.Window(1,Rect(180,0,150,150),popWin,"op1");
GUILayout.Window(2,Rect(360,0,150,150),popWin,"op2");
//------------------------------------------
switch(iFocus)
{case 1:GUI.FocusControl("tFXXX");break;
case 2:GUI.FocusControl("tFYYY");break;
case 3:GUI.FocusControl("tFLogin");break;
case 3:GUI.FocusWindow(1);break;
case 4:GUI.FocusWindow(2);break;
case 5:GUI.UnfocusWindow();break;
default:print("Err");
}
}
function popWin(winID:int)
{GUILayout.Label("lease Check Your Info:",GUILayout.Width(150));
GUILayout.Label("\nlogin\t\t:");
GUILayout.Label("login2\t:");
GUILayout.BeginHorizontal();
GUILayout.Button("Yes.");
GUILayout.Button("No.");
GUILayout.EndHorizontal();
}
function FixedUpdate()
{iFocus=Mathf.Floor(Time.time)%6;
}[/code]
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|