Class ScyllaToolbar
A top toolbar strip UnityEngine.UIElements.VisualElement with convenience methods for
adding UnityEngine.UIElements.Button controls, flexible spacers, and Label elements.
Styled via the scylla-toolbar USS class (flex-direction: row is
applied by the USS class, not inline).
Implements
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
public sealed class ScyllaToolbar : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle
Remarks
Use AddButton(string, Action) and AddFlexibleSpace() to compose
a standard toolbar layout (left-aligned buttons, spacer, right-aligned buttons).
Any UnityEngine.UIElements.VisualElement can also be added directly via the inherited
Add method for controls that are not covered by the convenience helpers
(e.g., ToolbarToggle, DropdownField).
Buttons added via AddButton(string, Action) receive the
scylla-toolbar__button USS class for consistent toolbar button styling.
Constructors
ScyllaToolbar()
Creates a new empty toolbar and applies the scylla-toolbar USS class.
Add child controls via AddButton(string, Action), AddFlexibleSpace(),
AddLabel(string), or the inherited Add method.
Declaration
public ScyllaToolbar()
Methods
AddButton(string, Action)
Creates a UnityEngine.UIElements.Button with the scylla-toolbar__button USS class,
appends it to the toolbar, and returns it. The button is inserted at the end
of the current child list.
Declaration
public Button AddButton(string text, Action onClick)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | Label text displayed on the button. |
| Action | onClick | Click handler invoked when the button is pressed. |
Returns
| Type | Description |
|---|---|
| Button | The newly created and added UnityEngine.UIElements.Button. |
AddFlexibleSpace()
Inserts a flex-grow spacer that expands to fill all remaining horizontal space, pushing any elements added after this call to the right edge of the toolbar.
Declaration
public void AddFlexibleSpace()
AddLabel(string)
Creates a UnityEngine.UIElements.Label styled with the TOOLBAR_LABEL USS class, appends it to the toolbar, and returns it. Useful for adding read-only status text alongside toolbar buttons.
Declaration
public Label AddLabel(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The display text for the label. |
Returns
| Type | Description |
|---|---|
| Label | The newly created and added UnityEngine.UIElements.Label. |