鸟语天空
GUI.DragWindow()
post by:追风剑情 2014-7-21 22:14

using UnityEngine;
using System.Collections;

public class GUIDragWindow : MonoBehaviour {

	Rect windowRect = new Rect (20, 20, 250, 250);

	void OnGUI () {
		windowRect = GUI.Window (0, windowRect, DoMyWindow, "My Window");
	}

	void DoMyWindow (int windowID) {

		GUI.Button (new Rect (10,20,100,20), "Can't drag me");

		//GUI.DragWindow (new Rect (0,0, 1000, 20));//Rect设置Drag区域
		GUI.DragWindow ();
	}
}

运行效果

运行效果dragwindow.png

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容