Class ScyllaInputContextConfigurationEditor
Custom Unity inspector for ScyllaInputContextConfiguration assets built entirely with UI Toolkit.
Inheritance
Inherited Members
Namespace: Scylla.Input.Editor
Assembly: ScyllaInput.Editor.dll
Syntax
[CustomEditor(typeof(ScyllaInputContextConfiguration))]
public sealed class ScyllaInputContextConfigurationEditor : ScyllaConfigurationEditorBase
Remarks
The inspector presents all InputContextDefinition entries stored on the
asset in a multi-column UnityEngine.UIElements.ListView with five visible columns: Context ID,
Display Name, Priority, Blocks (lower priority), and Consumes (all input). Rows use
Unity's dual-binding pattern: the list's bindingPath wires the array size so
the view rebuilds automatically when entries are added or removed, while the per-cell
bindItem handler binds each row's individual fields to the indexed array
element via BindProperty. A custom column header bar sits
above the list to label the columns.
Below the list an action row contains the "Validate Contexts" button (left-aligned)
and the "Remove All" destructive button (right-aligned, styled with the
scylla-button-destructive USS class). "Remove All" shows a confirmation
dialog before clearing the array.
Selecting a row rebuilds the detail panel below the separator. The detail panel is
wrapped in a scylla-section-box card and shows the full set of editable
context properties: Context ID, Display Name, Priority, multi-line Description,
Exclusion Group, Blocks Lower Priority toggle, Consumes All Input toggle, and the
Enabled and Disabled Action Map lists. When both "Blocks Lower Priority" and
"Consumes All Input" are enabled simultaneously, a warning UnityEngine.UIElements.HelpBox
appears explaining the redundancy; this is wired via
RegisterValueChangedCallback on both toggles.
Deselecting a row hides the panel and reveals an empty-state hint outside the box.
Each action map list (Enabled and Disabled) uses a dynamic DropdownField
populated from the cached InputActionAsset.actionMaps list when an
asset is available. The asset is resolved in priority order: the
InputActionAsset assigned in ScyllaInputConfiguration is
preferred; if none is assigned, Unity's project-wide actions (InputSystem.actions)
are used as a fallback; if neither is present the list falls back to plain
TextField entries. The action map cache is invalidated on project changes and
refreshed lazily on next panel open. A "Refresh" button and a muted hint label appear
when the cache is empty.
The Validate Contexts button calls Validate() and routes results by Scylla.Core.Config.ValidationSeverity to the Unity Console, then summarizes the counts in an DisplayDialog(string, string, string, string) dialog.
Methods
BuildConfigurationContent(VisualElement)
Populates the configuration properties section. Subclasses add their
UnityEditor.UIElements.PropertyField elements to the supplied container.
The base implementation iterates all serialized properties (excluding script,
metadata, and config-file fields) and renders each one with its tooltip as an
inline muted description above the field, mirroring the IMGUI baseline.
Declaration
protected override void BuildConfigurationContent(VisualElement container)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | container | The highlighted box container to add property fields to. |
Overrides
Remarks
Builds the full context list surface: a bold count label, the custom column header bar, the UnityEngine.UIElements.ListView, the action row (Validate Contexts / Remove All), a horizontal separator, and the initially-hidden detail panel card plus the empty-state hint. Calls Scylla.Input.Editor.ScyllaInputContextConfigurationEditor.RefreshHeaderLabel(), Scylla.Input.Editor.ScyllaInputContextConfigurationEditor.RefreshRemoveAllEnabled(), and Scylla.Input.Editor.ScyllaInputContextConfigurationEditor.RebuildDetailPanel() once the structure is assembled.