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 : OdinEditor

Inherits: OdinEditor (Sirenix.OdinInspector.Editor) Attribute: [CustomEditor(typeof(InputActionScheme))]

Remarks

This editor replaces the default inspector for InputActionScheme with a two-section layout:

  1. Asset field — Always shown. Allows assigning an InputActionAsset to the scheme.

  2. Bindings — Only shown when scheme.HasAsset is true. 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

Goal
How

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:

  1. Tree.BeginDraw(true) — begins Odin property tree drawing

  2. Tree.DrawPropertyAtPath("asset") — always draws the InputActionAsset field

  3. If scheme.HasAsset: Tree.DrawPropertyAtPath("bindings") — draws the bindings collection

  4. Tree.EndDraw() — ends Odin property tree drawing

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

Last updated