Class ScyllaModuleEditor
Generic custom inspector for all ScyllaModule MonoBehaviour subclasses,
built entirely with UI Toolkit. Registered with [CustomEditor(typeof(ScyllaModule), true)]
so it applies to every concrete module unless the module provides its own
[CustomEditor] subclass.
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
[CustomEditor(typeof(ScyllaModule), true)]
public class ScyllaModuleEditor : ScyllaEditorBase
Remarks
Presents a consistent eight-section layout rendered from top to bottom:
- Header - module name, ID, version, and optional description.
- Configuration - one or more configuration asset slots with auto-discovery sub-rows.
- Status - current ScyllaModuleState, is-enabled flag, and init priority.
- Dependencies - color-coded list of ScyllaModuleDependency entries (Hard=red, Soft=yellow, EventBased=blue).
- Runtime - framework initialization status and Enable/Disable buttons; visible during Play mode only.
- Properties - any serialized fields not already covered by configuration slots.
- Actions - Select Core and Check Dependencies buttons.
- Validation - live ConfigurationValidationResult messages polled every 500 ms.
All section-builder methods are declared virtual so module-specific editor
subclasses can override individual sections while inheriting the full standard layout.
Override Build*Section and call base.Build*Section when extending rather
than replacing a section.
Live data (runtime status, validation messages) is refreshed every
RUNTIME_POLL_MS (500 ms) via RecurringSafe(VisualElement, Action, long).
The scheduler auto-pauses when the inspector is detached from the panel, so no
manual cleanup is needed.
Methods
BuildActionsSection(VisualElement)
Builds and adds the Actions row to root. Contains a "Select Core"
button that pings the parent ScyllaBootstrap GameObject in the
hierarchy, and a "Check Dependencies" button (edit mode only) that logs dependency
resolution results to the Unity console. A muted hint label beneath the buttons
reminds users that modules are managed by ScyllaBootstrap.
Declaration
protected virtual void BuildActionsSection(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector root to add the actions row to. |
BuildConfigurationSection()
Builds and returns the Configuration foldout. For each configuration type reported by
the module, a slot row is created that shows the assigned asset name, an optional
auto-discovered default via Resources.Load, or a "Using default settings"
label with a Create button. Each slot updates its sub-row in place when the
UnityEditor.UIElements.PropertyField assignment changes, via RegisterValueChangeCallback.
Declaration
protected virtual VisualElement BuildConfigurationSection()
Returns
| Type | Description |
|---|---|
| VisualElement | A UnityEngine.UIElements.Foldout containing all configuration slots, or an empty element when no configuration type is declared. |
BuildDependenciesSection(VisualElement)
Builds and adds the Dependencies foldout to root. Each
ScyllaModuleDependency is rendered as a row with a color-coded type
tag (Hard = red, Soft = yellow, EventBased = blue), the module ID, and an optional
minimum-version label. The foldout is collapsed by default and shows the dependency
count in its title. If no dependencies are declared, a muted "No dependencies
defined" label is shown instead. Returns early if ScyllaModuleInfo
is null.
Declaration
protected virtual void BuildDependenciesSection(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector root to add the dependencies foldout to. |
BuildHeaderSection(VisualElement)
Builds and adds the header section to root. The header shows the
module name as a bold title, the module ID and version as a subtitle, and the module
description as a muted label underneath. If ScyllaModuleInfo is not yet
available, a warning help box is rendered instead.
Declaration
protected virtual void BuildHeaderSection(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector root to add the header to. |
BuildInspector(VisualElement)
Subclasses populate root with their inspector content.
The root has the shared Scylla stylesheets pre-loaded.
Declaration
protected override void BuildInspector(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector's root element. |
Overrides
BuildPropertiesSection(VisualElement)
Builds and adds the Module Properties foldout to root. Iterates
the module's serialized properties, skipping the configuration slot fields (resolved
from GetConfigurationTypes()), the legacy configuration
field, and the script reference. If no visible properties remain after exclusion,
the section is omitted entirely to avoid an empty foldout.
Declaration
protected virtual void BuildPropertiesSection(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector root to add the properties foldout to. |
BuildRuntimeSectionContent(VisualElement)
Builds and adds the Runtime Information foldout to root. The
foldout contains an edit-mode placeholder help box ("Runtime information available
during Play mode") and a BuildRuntimeContainer() group that shows the
ScyllaCore initialization status, a state-specific tip, and Enable /
Disable buttons. The runtime container is automatically shown and the placeholder
hidden when entering Play mode via EditorApplication.playModeStateChanged.
The Enable and Disable buttons' enabled state is managed by the 500 ms refresh tick.
Declaration
protected virtual void BuildRuntimeSectionContent(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector root to add the runtime foldout to. |
BuildStatusSection(VisualElement)
Builds and adds the Module Status foldout to root. Displays the
module's current ScyllaModuleState as a string, an Is Enabled flag
colored green when enabled and gray when disabled, and the initialization priority
from ScyllaModuleInfo. The state and enabled labels are refreshed by
the 500 ms poll via Scylla.Core.Editor.ScyllaModuleEditor.RefreshStatusDisplay().
Declaration
protected virtual void BuildStatusSection(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector root to add the status foldout to. |
BuildValidationSection(VisualElement)
Builds and adds the Validation foldout to root. The container is
initially populated by Scylla.Core.Editor.ScyllaModuleEditor.PopulateValidation() and refreshed every 500 ms.
If no validation results are present the section is omitted entirely. Results are
sourced from ConfigurationRegistry.ValidateAll() when available, or from the
module's primary configuration's Validate() otherwise.
Declaration
protected virtual void BuildValidationSection(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector root to add the validation foldout to. |