EditorWindow inherits from ScriptableObject
1. Variables
1. Static variables
variable name |
official explanation |
scenes to be used |
focusWindow |
The EditorWindow that currently has the keyboard focus. (read only) |
|
mouseOverWindow |
The EditorWindow currently under the mouse cursor. (read only) |
|
2. Variables
variable name |
official explanation |
scenes to be used |
titleContent |
The GUIContent used to draw the EditorWindow's title. |
|
position |
The desired position of the window in screen space. |
|
maxSize |
window maximum |
|
minSize |
window minimum |
|
maximized |
Is this window maximized? |
|
rootVisualElement |
Get the root visual element of the window hierarchy view. |
|
hasFocus |
whether the window is focused |
|
autoRepaintOnSceneChange |
Will the window redraw automatically every time the scene changes? |
|
docked |
Returns true if EditorWindow is docked. |
|
hasUnsavedChanges |
This property specifies whether the Editor prompts the user to save or discard unsaved changes before the window closes. |
|
saveChangesMessage |
The message that displays to the user if they are prompted to save |
|
wantsLessLayoutEvents |
Specifies whether a layout pass is performed before all user events (for example, EventType.MouseDown or [[EventType, KeyDown]]), or is only performed before repaint events. |
|
wantsMouseEnterLeaveWindow |
Checks that MouseEnterWindow and MouseLeaveWindow events have been received in the GUI for this editor window. |
|
wantsMouseMove |
Checks to see if MouseMove events have been received in the GUI of this editor window. |
|
2. Method
1. Protected methods
variable name |
official explanation |
scenes to be used |
OnBackingScaleFactorChanged |
Called when the UI scaling for this EditorWindow is changed. |
|
2. Static method
variable name |
official explanation |
scenes to be used |
CreateWindow |
Creates an EditorWindow of type T. |
|
FocusWindowIfItsOpen |
Focuses the first found EditorWindow of the specified type (if already open). |
|
GetWindow |
Returns the first EditorWindow of type t on the current screen. |
|
GetWindowWithRect |
Returns the first EditorWindow of type t on the current screen. |
|
HasOpenInstances |
Checks if an editor window is open. |
|
3. Method
三、消息(生命周期)
Awake |
在新窗口打开时调用。 |
CreateGUI |
CreateGUI is called when the EditorWindow's rootVisualElement is ready to be populated. |
hasUnsavedChanges |
This property specifies whether the Editor prompts the user to save or discard unsaved changes before the window closes. |
OnDestroy |
调用 OnDestroy 以关闭 EditorWindow 窗口。 |
OnFocus |
在窗口获得键盘焦点时调用。 |
OnGUI |
在此处实现您自己的 Editor GUI。 |
OnHierarchyChange |
处理程序,用于在层级视图中的对象或对象组发生更改时发送的消息。 |
OnInspectorUpdate |
OnInspectorUpdate 以每秒 10 帧的速度调用,以便检视面板有机会进行更新。 |
OnLostFocus |
Called when a window loses keyboard focus. |
OnProjectChange |
Handler for messages sent when the item state changes. |
OnSelectionChange |
Called whenever the selection changes. |
saveChangesMessage |
The message that displays to the user if they are prompted to save |
Update |
Called multiple times per second on all visible windows. |