Editor

Editor tooling for ParagonBehaviour and its subsystem/component architecture. Provides custom Inspector rendering, a context menu for toggling subsystems and debug mode, and a visual UI Toolkit-based drawer for managing subsystem components.

Architecture

spinner

Key Concepts

Concept
Description

ParagonBehaviourEditor

Custom Odin-based Inspector editor for all ParagonBehaviour subclasses. Manages the subsystem property and debug toggle.

ParagonBehaviourContextMenu

Injects a gear icon into the editor header of every ParagonBehaviour. Provides context menu items for toggling subsystems and debug mode.

ParagonSubsystemDrawer

UI Toolkit-based Odin property drawer that renders the subsystem's component list with expandable toolboxes and an add/remove workflow.

ParagonSubsystemSelector

Popup type selector (using Odin's GenericSelector<Type>) for picking which component type to add to a subsystem.

How It Works

  1. Header Context MenuParagonBehaviourContextMenu uses EditorHeaderItemInjector to add a gear icon to every ParagonBehaviour Inspector header. Clicking it reveals a dropdown with "Use Subsystem" (if applicable) and "Enable Debug" toggles.

  2. Subsystem Toggle — When "Use Subsystem" is toggled, ParagonBehaviourEditor.EnableSubsystem() creates a new ParagonSubsystem<T> instance and assigns it to the behaviour's serialized subsystem field. Disabling nulls it out.

  3. Component Drawing — When a subsystem is active, ParagonSubsystemDrawer renders each IParagonComponent in a Toolbox with expand/collapse, remove buttons, and right-click context menus (copy/paste/reset). The "+" button opens ParagonSubsystemSelector.

  4. Component SelectionParagonSubsystemSelector queries TypeCache for all concrete types implementing IParagonComponent<TBehaviour> that aren't already present, displays them in a searchable popup, and adds the selected type to the subsystem.

Classes

Class
Description

Injects header context menu for subsystem and debug toggles

Custom Inspector editor for all ParagonBehaviour types

UI Toolkit drawer for subsystem component management

Type selection popup for adding components

Last updated