class GUIWindowDemo extends EditorWindow
{
var windowRect = Rect (100,100,200,200);
function OnGUI ()
{
BeginWindows ();
windowRect = GUILayout.Window (1, windowRect, DoWindow, "Hi There");
EndWindows ();
}
function DoWindow ()
{
GUILayout.Button ("Hi");
GUI.DragWindow ();
}
@MenuItem ("Test/GUIWindow Demo")
static function Init () {
EditorWindow.GetWindow (GUIWindowDemo);
}
}
-------------------------------------------------------------------------------------------------
class GUIWindowDemo2 extends EditorWindow
{
var windowRect = Rect (100,100,200,200);
var scrollPos = Vector2.zero;
function OnGUI ()
{
scrollPos = GUI.BeginScrollView (
new Rect (0, 0, position.width, position.height),
scrollPos,
new Rect (0, 0, 1000, 1000)
);
BeginWindows ();
windowRect = GUILayout.Window (1, windowRect, DoWindow, "test");
EndWindows ();
GUI.EndScrollView ();
}
function DoWindow ()
{
GUILayout.Button ("Hi");
GUILayout.Button ("H2");
GUI.DragWindow ();
}
@MenuItem ("Test/GUIWindow Demo 2")
static function Init ()
{
EditorWindow.GetWindow (GUIWindowDemo2);
}
}