- 最后登录
- 2016-8-29
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 23585
- 纳金币
- 20645
- 精华
- 62
|
using UnityEngine;
using System.Collections;
public class GUIXX : MonoBehaviour {
// Use this for initialization
//~ Rect windowRect;
ArrayList windowRect=new ArrayList();
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI()
{
if (GUILayout.Button ("Add Window"))
{
windowRect.Add(new Rect(200+windowRect.Count*40,200+windowRect.Count*50,120,56));
}
for(int i=0;i<windowRect.Count;i++)
{
windowRect= GUILayout.Window (i, (Rect)windowRect, DoMyWindow, "My Window");
}
}
void DoMyWindow (int windowID) {
if (GUILayout.Button ("Hello World"))
{
windowRect.RemoveAt(windowID);
}
GUI.DragWindow(new Rect(0,0, 10000, 500));
}
} |
|