EditorWindow
- autoRepaintOnSceneChange
- BeginWindows
- Close
- EndWindows
- focusedWindow
- FocusWindowIfItsOpen.<T>
- FocusWindowIfItsOpen
- Focus
- GetWindow.<T>
- GetWindowWithRect.<T>
- GetWindowWithRect
- GetWindow
- mouseOverWindow
- OnDestroy
- OnFocus
- OnGUI
- OnHierarchyChange
- OnInspectorUpdate
- OnLostFocus
- OnProjectChange
- OnSelectionChange
- position
- RemoveNotification
- Repaint
- SendEvent
- ShowAuxWindow
- ShowNotification
- ShowPopup
- ShowTab
- ShowUtility
- Show
- Update
- wantsMouseMove
EditorWindow.EndWindows 结束窗口
function EndWindows () : void
Description描述
Close a window group started with EditorWindow.BeginWindows
关闭一个开始于EditorWindow.BeginWindows的窗口组。
Simple editor Window with a window and a button inside.
带有一个窗口和一个按钮的简单编辑器窗口。
class GUIWindowDemo extends EditorWindow {
// The position of the window
//窗口的位置
var windowRect = Rect (100,100,200,200);
// Main GUI Function //主GUI函数
function OnGUI () {
// Begin Window
BeginWindows ();
// All GUI.Window or GUILayout.Window must come inside here
//所有GUI.Window 或 GUILayout.Window 必须在这里面
windowRect = GUILayout.Window (1, windowRect, DoWindow, "Hi There");
// Collect all the windows between the two.
//在这两者之间搜集所有窗口
EndWindows ();
}
// The window function. This works just like ingame GUI.Window
//窗口函数,这就像游戏内的GUI.Window
function DoWindow () {
GUILayout.Button ("Hi");
GUI.DragWindow ();
}
// Add menu item to show this demo.
//添加菜单项来显示这个演示
@MenuItem ("Test/GUIWindow Demo")
static function Init () {
EditorWindow.GetWindow (GUIWindowDemo);
}
}
The placement of the BeginWindows / EndWindows pair determines where popup windows will appear; all windows are clipped to the clipping area defined by GUI.BeginGroup or GUI.BeginScrollview. A small example of that
BeginWindows / EndWindows对的放置决定弹出窗口的显示。所有窗口都放到GUI.BeginGroup 或 GUI.BeginScrollview中定义。一个简单的例子:
Simple editor window with a window and a button inside using scroll bars.
带有一个窗口和一个按钮,使用滚动条的简单编辑器窗口。
class GUIWindowDemo2 extends EditorWindow {
// The position of the window
//窗口的位置
var windowRect = Rect (100,100,200,200);
// Scroll position 滚动位置
var scrollPos = Vector2.zero;
function OnGUI () {
// Set up a scroll view 设置滚动视图
scrollPos = GUI.BeginScrollView (
new Rect (0, 0, position.width, position.height),
scrollPos,
new Rect (0, 0, 1000, 1000)
);
// Same code as before - make a window. Only now, it's INSIDE the scrollview
//创建一个窗口,仅限在,在滚动视图中
BeginWindows ();
windowRect = GUILayout.Window (1, windowRect, DoWindow, "Hi There");
EndWindows ();
// Close the scroll view 关闭滚动视图
GUI.EndScrollView ();
}
function DoWindow () {
GUILayout.Button ("Hi");
GUI.DragWindow ();
}
@MenuItem ("Test/GUIWindow Demo 2")
static function Init () {
EditorWindow.GetWindow (GUIWindowDemo2);
}
}
最后修改:2011年5月29日 Sunday 12:35