GUI.DragWindow()

作者:追风剑情 发布于:2014-7-21 22:14 分类:GUI

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

标签: DragWindow

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号