class
ManagedEditorWindow
Allows user to create dockable editor windows in managed code.
Each managed editor window implementation is wrapped in this object and then managed by its parent interop object of ScriptEditorWindow type.
Public
Constructors
ManagedEditorWindow
Constructs a new managed window.
- ns
- Namespace of the window type.
- type
- Name of the window type.
- defaultSize
- Default width/height of the window when initially created.
- localUndoRedo
- Determines should the window use a local undo/redo stack instead of the global one.
- tabGroup
- Container to initially dock the window in.
Methods
~ManagedEditorWindow
staticCreateScriptObject
Attempts to create a script object for the editor window described by the provided type.
Returned object will not have the constructor called.
IsInitialized
Checks has the OnInitialize method been called yet.
GetNamespace
Returns the namespace of the managed window type.
GetTypename
Returns the managed window type name.
Update
Called once every frame.
Close
Closes and destroys the window.
WrapCursorToWindow
Moves the cursor so it is within the window bounds.
Returns the offset that the cursor was moved by.
IsPointerOverWindow
Checks is the pointer currently over the window area.
SetupScriptBindings
Sets up script bindings between native and managed class.
Must be called after creating the script object wrapper, or after assembly is reloaded.
TriggerOnInitialize
Triggers OnInitialize callbacks on the managed instance.
TriggerOnDestroy
Triggers OnDestroy callbacks on the managed instance.
GetUndoRedo
Returns the local undo/redo stack specific to this editor window.
Only windows marked with [UndoRedoLocal] attribute will return a non-null value.
staticGetOrOpenWindow
Attempts to find an existing managed editor window with the provided name, or if not found attempts to open a new instance of the window.
- nameSpace
- Namespace of the managed window type.
- typeName
- Type name of the managed window type.
Returns: Instance of the managed window, or null if window cannot be found or opened.
staticGetWindow
Attempts to find a currently open managed editor window with the provided name.
- nameSpace
- Namespace of the managed window type.
- typeName
- Type name of the managed window type.
Returns: Instance of the managed window, or null if an open window is not found.
staticGetAllOpenWindows
Returns a list of all currently open managed windows.
Internal
Methods
staticRegisterManagedEditorWindows
Finds all editor window implementations in managed assemblies and registers them with the editor window system.
staticClearRegisteredEditorWindows
Removes all editor windows registered previously with RegisterManagedEditorWindows().
Useful during assembly refresh when editor window implementations might be added/removed.
Private
Methods
ShouldPersistScriptReload
If true, the object will be given an opportunity to back up its data before a script reload operation, and its script object will be automatically recreated once script reload ends, and given an opportunity to restore the backed up data.
If false, the script object and its wrapper will be destroyed on script reload.
NotifyScriptWillReload
Called on all script objects before script object reload happens.
RecreateScriptObjectAfterScriptReload
Called on all script objects after script assemblies have been reloaded.
This needs to recreate the internal script object using the new assemblies, as the old one will have been destroyed during the reload. Only relevant for script objects that persist script reload (i.e. ShouldPersistScriptReload() returns true). Returns true if the script object was created, otherwise the responsibility will fall to the script object wrapper.
NotifyScriptReloadFinished
Called on all script object wrappers as the final step in script reload, after RestoreDataAfterScriptReload().
Allows you to perform actions that require the entire scripting world to be fully recreated.
DoOnWindowResized
Triggered when the native editor window is resized.
DoOnFocusChanged
Triggered when the native editor window gains or loses focus.
staticRegisterScriptEditorWindow
Registers a newly created editor window interop object and adds it to a list of currently active editor windows.
staticUnregisterScriptEditorWindow
Removes a window from the active editor window list.
- windowTypeName
- Name of the window type. Provided by ManagedEditorWindow::GetName().
staticOpenEditorWindowCallback
Callback that is triggered when user requests a window to be opened.