InputActionSchemeEditor
Custom Odin editor for the InputActionScheme MonoBehaviour. Provides a streamlined inspector that conditionally shows the bindings section based on whether an InputActionAsset has been assigned.
Definition
Namespace: Paragon.Core.InputSystem.Editor Assembly: Paragon.Editor.dll
[CustomEditor(typeof(InputActionScheme))]
public class InputActionSchemeEditor : OdinEditorInherits: OdinEditor (Sirenix.OdinInspector.Editor) Attribute: [CustomEditor(typeof(InputActionScheme))]
Remarks
This editor replaces the default inspector for InputActionScheme with a two-section layout:
Asset field — Always shown. Allows assigning an
InputActionAssetto the scheme.Bindings — Only shown when
scheme.HasAssetistrue. Rendered by InputActionSchemeBindingsDrawer.
This conditional rendering prevents displaying an empty binding list when no asset is assigned, providing a cleaner user experience. The bindings auto-populate via ValidateBindings() once an asset is assigned (triggered by OnValidate()).
Manual Tree Drawing
The editor uses Tree.BeginDraw(true) / Tree.EndDraw() with DrawPropertyAtPath() for explicit control over which properties are rendered and in what order. This bypasses Odin's default "draw all properties" behavior.
Quick Lookup
Assign an Input Action Asset
Drag an InputActionAsset into the "Asset" field
View/configure bindings
Assign an asset first — bindings section appears automatically
Select binding types
Use the polymorphic field on each action map entry
Properties
scheme (private)
Convenience accessor to the inspected InputActionScheme component.
Methods
OnInspectorGUI
Main draw method. Renders the asset field unconditionally and the bindings property conditionally.
Behavior:
Tree.BeginDraw(true)— begins Odin property tree drawingTree.DrawPropertyAtPath("asset")— always draws theInputActionAssetfieldIf
scheme.HasAsset:Tree.DrawPropertyAtPath("bindings")— draws the bindings collectionTree.EndDraw()— ends Odin property tree drawing
Common Pitfalls
Bindings hidden without asset If no InputActionAsset is assigned, the bindings section is completely hidden. Users must assign an asset before they can configure bindings. This is by design — bindings cannot be validated without an asset.
Property paths are hardcoded The editor uses DrawPropertyAtPath("asset") and DrawPropertyAtPath("bindings") with hardcoded string paths. If the field names in InputActionScheme are changed, these paths will silently fail to render.
See Also
InputActionScheme — runtime class this editor inspects
InputActionSchemeBindingsDrawer — drawer for the bindings section
Editor Overview — editor tooling overview
Last updated