Class ScyllaPanel
Base class for swappable content panels within a Scylla UI Toolkit tool window. Provides a root UnityEngine.UIElements.VisualElement and lifecycle hooks for activation and deactivation when panels are switched via a tab bar.
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
public abstract class ScyllaPanel
Remarks
Lifecycle. The owning window calls OnActivated() when this panel becomes the active panel (tab selected), and OnDeactivated() when another panel replaces it. Subclasses can override these to start/stop updates, refresh data, or release resources.
Root element. The Root VisualElement is created once in the constructor. It persists across activation/deactivation cycles. The owning window adds/removes Root from the content container.
Constructors
ScyllaPanel(string)
Creates a new panel with the specified title.
Declaration
protected ScyllaPanel(string title)
Parameters
| Type | Name | Description |
|---|---|---|
| string | title | The display name shown in the tab bar. |
Properties
IsActive
Whether this panel is currently the active (visible) panel.
Declaration
public bool IsActive { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Root
The root VisualElement for this panel's content. The owning window adds this to its content container when the panel is activated.
Declaration
public VisualElement Root { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Title
The display name of this panel, shown in the tab bar.
Declaration
public string Title { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Activate()
Called by the owning window when this panel becomes the active panel. Do not call directly.
Declaration
public void Activate()
BuildContent()
Override to build the panel's VisualElement hierarchy. Called once from the constructor. Add child elements to Root.
Declaration
protected abstract void BuildContent()
Deactivate()
Called by the owning window when this panel is replaced by another panel. Do not call directly.
Declaration
public void Deactivate()
OnActivated()
Override to perform actions when this panel becomes active (e.g., refresh data, start periodic updates). Called after Root is added to the content container.
Declaration
protected virtual void OnActivated()
OnDeactivated()
Override to perform cleanup when this panel is deactivated (e.g., stop updates, release textures). Called before Root is removed from the content container.
Declaration
protected virtual void OnDeactivated()
Rebuild()
Clears the panel's root element and rebuilds its visual hierarchy by re-invoking BuildContent(). Useful for resetting a panel to its default visual state after its backing preferences have been deleted. Does not modify the panel's active/inactive lifecycle state.
Declaration
public void Rebuild()
ResetState()
Resets this panel's transient state (persisted preferences, UI control values) to defaults. Project assets are never modified. Override in subclasses to clear panel-specific EditorPrefs and reload defaults. The base implementation is a no-op.
Declaration
public virtual void ResetState()