Overlay
class in
UnityEditor.Overlays
Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Description
Overlays are persistent and customizable panels and toolbars that are available within Editor Windows. Use Overlays to expose actions and tool options in a convenient and user-controllable way.
This is the base class from which all Overlays inherit. To create an Overlay, return a UnityEngine.UIElements.VisualElement.
To create an Overlay that is dockable in a toolbar, see ToolbarOverlay.
Properties
collapsed | Defines whether the overlay is in collapsed form. |
containerWindow | EditorWindow the overlay is contained within. |
displayed | Shows or hides the overlay. |
displayName | Name of overlay used as title. |
floating | Returns true if overlay is floating, returns false if overlay is docked in a corner or in a toolbar. |
floatingPosition | Local position of closest overlay corner to closest dockposition when floating. |
id | Overlay unique ID. |
isInToolbar | Returns true if overlay is docked in a toolbar. |
layout | Describes the presentation mode for an Overlay. |
Public Methods
Close | Remove the Overlay from its OverlayCanvas. |
CreateContent | Create a new VisualElement containing the contents of this Overlay. |
CreatePanelContent | Implement this method to return your visual element content. |
OnCreated | OnCreated is invoked when an Overlay is instantiated in an Overlay Canvas. |
OnWillBeDestroyed | Called when an Overlay is about to be destroyed. |
Undock | If this Overlay is currently in a toolbar, it will be removed and return to a floating state. |