Class ScyllaTabBar
A horizontal tab strip UnityEngine.UIElements.VisualElement for switching between panels.
Styled via the scylla-tabbar USS class family (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 ScyllaTabBar : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle
Remarks
Each tab is a UnityEngine.UIElements.VisualElement with the scylla-tabbar__tab
class containing a Label child with the scylla-tabbar__tab-label
class. The active tab carries the additional scylla-tabbar__tab--active
modifier class for selected-state styling.
Clicking a tab calls SetActiveTab(int) internally. The caller can also drive selection programmatically via SetActiveTab(int). The TabSelected event fires whenever the active index changes from either source, but not when the same tab is clicked again.
Individual tabs can be retrieved via GetTab(int) for additional styling or for adding supplementary child elements (e.g., an icon badge).
Constructors
ScyllaTabBar(params string[])
Creates a tab bar with the specified tab labels and no tooltips.
Equivalent to calling ScyllaTabBar(string[], string[]) with
tooltips = null.
Declaration
public ScyllaTabBar(params string[] labels)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | labels | Display text for each tab. Must contain at least one entry; each entry
becomes the text of that tab's inner |
ScyllaTabBar(string[], string[])
Creates a tab bar with the specified tab labels and optional per-tab tooltips. Clicking any tab calls SetActiveTab(int) with that tab's index.
Declaration
public ScyllaTabBar(string[] labels, string[] tooltips)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | labels | Display text for each tab. Must contain at least one entry. |
| string[] | tooltips | Optional tooltip strings, one per tab. Individual entries may be |
Properties
ActiveIndex
The zero-based index of the currently active tab, or -1 if none.
Declaration
public int ActiveIndex { get; }
Property Value
| Type | Description |
|---|---|
| int |
TabCount
The number of tabs in the bar.
Declaration
public int TabCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
GetTab(int)
Returns the tab container UnityEngine.UIElements.VisualElement at index
for per-tab styling or adding supplementary child elements.
Declaration
public VisualElement GetTab(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Zero-based tab index. Must be in the range [0, TabCount). |
Returns
| Type | Description |
|---|---|
| VisualElement | The tab container UnityEngine.UIElements.VisualElement at the given index. |
SetActiveTab(int)
Sets the active tab to index. Removes the active modifier
class from the previously active tab, applies it to the new one, and fires
TabSelected. Does nothing when index is out of
range or already matches ActiveIndex.
Declaration
public void SetActiveTab(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Zero-based index of the tab to activate. Values outside [0, TabCount) are silently ignored. |
Events
TabSelected
Fired when the selected tab changes. The argument is the new active tab index.
Declaration
public event Action<int> TabSelected
Event Type
| Type | Description |
|---|---|
| Action<int> |