GUI布局、栏目自动提示代码 附源码
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;
}
这个怎么用的啊 很不错 楼主是超人 真心顶 难得一见的好帖 不错不错 很不错 楼主是超人 顶顶多好
页:
[1]