Unity - Scripting API: MainToolbarDropdown
class in UnityEditor.Toolbars
/
Inherits from:Toolbars.MainToolbarElement
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.
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.
Description
Describes the content and behaviour of a dropdown element for the main toolbar.
Return an instance of this class through a static method registered with MainToolbarElementAttribute to add a dropdown element in the main toolbar. The following example demonstrates a dropdown that switches the active scene.
The following example demonstrates a simple selector dropdown.
Constructors
| Constructor | Description |
|---|---|
| MainToolbarDropdown | Specify the content and function of a main toolbar dropdown. |
Inherited Members
Properties
| Property | Description |
|---|---|
| content | The MainToolbarContent describes the content of a main toolbar element. For example, text, icon, or tooltip. |
| displayed | Specifies whether the `VisualElement` for this toolbar element should be displayed or not. Set to `True` by default. |
| enabled | Specifies whether a toolbar element should receive input events. Set to `True` by default. |
| populateContextMenu | Add content to the context menu that appears when you right-click this toolbar element. |