Most Editor controls appear in default windows and can be docked in the main app window. Windows usually perform two principal functions:
Window types found in the editor:
A default window with a tab and dock:
A window using popup-style framing:
A window using popup-style framing:
A single instance auxiliary window:
A persistent modal window:
A persistent modal window:
Dialogs are modal windows rendered by the operating system:
A default window with a tab and docking area with a window menu.
This window can be docked in tab docks to customize the environment and discreetly stack windows and panels contextually.
When released anywhere on the Editor, it will undock as a modal with a title bar and OS window controls.
The window is styled in the same way as a PopupWindow. This means the window is automatically closed when it loses focus and the window has no frame around the edge.
Note this function auto-fits the window to the screen while trying to place it first below then above the button it was triggered from. This means the windowSize might change when fitting it to the screen, so make sure to read the 'position' afterward to check whether the size was cropped.
Shows an Editor window using popup-style framing. This means the window has no frame, and is not draggable. It is intended for showing something like a popup menu within an existing window.
The single auxiliary window can be re-used by different editor windows at different times. Showing an editor window in the auxiliary window can be useful to avoid clutter of many small windows.
A persistent modal window. Other windows will not be accessible and any script recompilation will not happen until this window is closed.
When the utility window loses focus it remains on top of the new active window. This means the utility window is never hidden by the Unity Editor. It will be hidden when the user switches from Unity to another application.
Dialogs are messages that present a short-term task the user must perform to continue the operation. Users won't be able to interact with the Editor until the dialog is closed.
Default windows in the Editor are instantiated with a window tab, that can contain the name and the icon of the view, and a docking area where multiple tabs can be docked.
Tab labels contain the name of their window. These are meant to indicate the window’s purpose whether it is displayed or grouped behind other tabs. Tab labels should not be displayed vertically.
Only document window tabs, like scene, game, or Inspector should have icons in their tab label. Tool window tabs do not have icons. Tab icons should follow the standard Iconography guidelines. Icons should be simple intelligible glyphs relating to the tab contents. Icons should be placed to the left of the label with a 4px margin.
Tab container holds the tab label and icon (if applicable). The container is the area in which a tab’s context menu can be accessed. The tab container also holds the tab’s indicator which shows if the tab is being focused on.
Tabs have borders based on their order in the docking area. While regular tabs .dragtab have borders on both sides, a tab docked in the first position .dragtab-first only has a right border.
The space within a panel that tabs inhabit is the docking area. Although this is technically part of a panel it has an important effect on tab behavior and anatomy; it represents the area in which tabs can inhabit and where other tabs will be grouped when placed in the same panel.
Docking area acts as a container for tab labels, allowing for the placement of tab navigation elements and panel UI. As a result it is persistent even if there are no other tabs in the panel to convey the grouping functionality.
A temporary pop up menu that displays a list of options, triggered by a button or label that invites the user to select preferences.
Use an anchored menu when the items do not need to be visible unless being changed. If you need items to persist and be visible (for example for debugging or settings changes), use a radio button group in the UI or use a default or utility window.
A Unity Editor window body displays Editor content and allows user to interact with its contents. When floating, a Unity window is framed by the operating systems window element and a title bar.
It often consists of:
Most editor windows can be resized whether they are docked or floating. maxSize and minSize variables are used to provide the largest and smallest width and height that is supported.
Custom Editor windows allow you to extend Unity by implementing your own editors and workflows.
Follow the guidance below that covers: