Window Auto-Focus
The package supports focusing and/or opening any EditorWindow
when a Play, Pause or Stop (Edit mode) event happens. Instead of switching the entire layout, this option allows for nested tabs to be shown or hidden when it's best suited for them to appear.
For example, the Project window may only be needed during Edit mode, while the Console should instead appear during Play mode. Adding both windows to the correct sections will allow them to share the same screen space (nested) and switch automatically when pressing Play, similar to how Unity switches to the Game window by default, even if it's hidden by other windows.
Dropdown Selection
Using the plus dropdown button (+
) allows adding windows from a list of all available and non-hidden windows, including Unity Core
and Custom
windows.
If a window is already selected, a checkmark will be visible next to it's name and selecting it again will remove it from the current auto-focus list.
The popup list is automatically updated after a recompile, and should show all windows that derivate from UnityEditor.EditorWindow
, no matter if they are currently open and/or visible as long as they are not included in the "Hidden Windows" list.
Direct Selection
Using the hand selection button (👆) allows adding windows by directly clicking on them, without the need of searching the full list, or even knowing the type name of the window.
To add a window by direct selection, click the hand selection button (👆), click the window to add, and click back on the preferences window. The selection can be changed at any time during this flow, and it can also be canceled using the "Cancel" button.
Hidden Windows
Layouter allows any window to be focused and/or opened since it uses reflection to find all usages of UnityEditor.EditorWindow
. This comes with some drawbacks, as it allows opening windows that shouldn't be opened without context, and that will produce errors and warnings.
To avoid polluting the dropdown selection list with useless entries, the "Hidden Windows" text area contains a coma-separated full type name list of editor windows that shouldn't be shown.
Any type can be added to this list, allowing to hide any desired editor window from appearing on the dropdown selection list.
Layouter comes with a pre-defined list of windows that are unable to be opened without issues, and it can be restored / updated using the "Reset To Defaults" button.
Custom Window Focusing
Windows can be focused and opened at any time, regardless of the current editor status using the provided API in WindowFocus
.
WindowFocus.FindAndOpenWindows(new[] { "UnityEditor.ProjectBrowser", "UnityEditor.ConsoleWindow" });
WindowFocus.FindAndOpenWindow("UnityEditor.ConsoleWindow");
Note
Using default API's is always recommended. As long as the EditorWindow
to open is publicly defined, use EditorWindow.GetWindow
instead.