MainToolbarLabel
A label element for the main toolbar.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Class
- Namespace: UnityEditor.Toolbars
- Assembly: UnityEditor
- Inherits from: MainToolbarElement
[Icon("UIToolkit/Icons/Label.png")]public sealed class MainToolbarLabel : MainToolbarElement
Remarks
To add a label element in the main toolbar, use a static method registered with MainToolbarElementAttribute to return this class. To construct the content of the label, use MainToolbarContent.
Examples
using UnityEditor;using UnityEditor.Toolbars;using UnityEngine;public class MainToolbarLabelExample{ [MainToolbarElement("Examples/Information Label", defaultDockPosition = MainToolbarDockPosition.Middle)] public static MainToolbarElement InformationLabel() { return new MainToolbarLabel(new MainToolbarContent("Information", EditorGUIUtility.FindTexture("Search Icon"), "This shows information" )); }}
Constructors
Constructor | Description |
|---|---|
| MainToolbarLabel(UnityEditor.Toolbars.MainToolbarContent) | Specifies the content of a main toolbar label. |