false 发表于 2013-1-10 15:37

unity3d window、scroll窗口嵌套代码示例

var scrollVec : Vector2;
var cls:boolean=false;var xx = Rect (120, 120, 320, 250);function OnGUI(){
GUI.Window(0, Rect(Screen.width-100, 35, 100, 220 ), windowF, "Management");
if(cls)
xx = GUI.Window(1, xx, windowjj, "Warehouse");
}
function windowF(){
GUILayout.BeginArea(Rect(4, 20, 90, 170));
scrollVec = GUILayout.BeginScrollView(scrollVec);
if(GUILayout.Button ("Warehouse"))
cls=true;
GUILayout.Button("Start");
GUILayout.Button("Fighting");
GUILayout.Button("Back");
GUILayout.Button("1");
GUILayout.Button("2");
GUILayout.Button("3");
GUILayout.Button("4");
GUILayout.Button("5");
GUILayout.Button("6");
GUILayout.Button("7");
GUILayout.Button("8");
GUILayout.EndScrollView();
GUILayout.EndArea();
GUI.DragWindow ();
}
function windowjj(windowID : int){
GUILayout.BeginArea(Rect(130, 160, 50, 130));
if(GUILayout.Button("Close")) cls=false;
GUILayout.EndArea(); GUI.DragWindow ();}

裸睡的鱼 发表于 2013-1-10 16:13

学习了{:5_397:}{:5_397:}

shengbin88 发表于 2013-1-17 14:12

看完顶一个

ffanyboy 发表于 2013-1-26 01:17

学习了,谢谢

上海-双喜 发表于 2017-2-20 17:12

很不错

上海-双喜 发表于 2017-2-20 17:27

楼主是超人

sk205 发表于 2017-2-20 17:29

难得一见的好帖

349061667 发表于 2017-2-20 17:16

很好哦

349061667 发表于 2017-2-20 17:23

不错不错

hucongquan 发表于 2017-3-21 18:23

顶顶多好
页: [1]
查看完整版本: unity3d window、scroll窗口嵌套代码示例