InputActionScheme

MonoBehaviour component that serves as the root entry point for the Input System. Holds a Unity InputActionAsset reference and an InputActionSchemeBindings collection, providing methods to enable, disable, and query action maps and their bindings.

Definition

Namespace: Paragon.Core.InputSystem Assembly: Paragon.dll

public class InputActionScheme : ParagonBehaviour

Inherits: ParagonBehaviourSerializedMonoBehaviourMonoBehaviour

Remarks

InputActionScheme is the Inspector-facing component that ties together a Unity InputActionAsset with concrete InputActionMapBinding implementations. Each action map in the asset gets a corresponding binding slot in the InputActionSchemeBindings collection, which can be assigned in the Inspector.

When Enable() is called, it:

  1. Enables the entire InputActionAsset

  2. Iterates all bindings and calls Bind(autoEnable: true) on each, triggering reflection-based callback discovery and subscription

When Disable() is called, the reverse occurs — all bindings are unbound and the asset is disabled.

The OnValidate() hook calls ValidateBindings() on the bindings collection, which synchronizes binding slots with the current action maps in the asset (adding new slots, removing orphaned ones).

Quick Lookup

Goal
How

Enable all input

scheme.Enable()

Disable all input

scheme.Disable()

Enable one action map

scheme.EnableActionMap("UI")

Disable one action map

scheme.DisableActionMap("UI")

Check if enabled

scheme.IsEnabled

Check specific map

scheme.IsActionMapEnabled("Player")

Get an action map

scheme.GetActionMap("Player")

Get all action maps

scheme.GetActionMaps()

Properties

HasAsset

Whether an InputActionAsset is assigned.

IsEnabled

Whether the underlying InputActionAsset is currently enabled.

Name

The name of the assigned InputActionAsset.

Methods

Enable

Enables the entire InputActionAsset and binds all InputActionMapBinding handlers.

Each binding's Bind(autoEnable: true) is called, which:

  1. Resolves the InputActionMap from the asset

  2. Discovers [InputActionCallback] methods via reflection

  3. Subscribes wrapped callbacks to the appropriate input action phases

  4. Enables the action map

Disable

Disables the entire InputActionAsset and unbinds all handlers.

Each binding's Unbind(autoDisable: true) is called, which unsubscribes all callbacks and disables the action map.

GetActionMap

Finds an action map by name or ID. Throws if not found.

Parameter
Type
Description

nameOrId

string

Action map name or GUID

Returns: The matching InputActionMap.

circle-exclamation

EnableActionMap

Enables a specific action map by name.

DisableActionMap

Disables a specific action map by name.

IsActionMapEnabled

Checks whether a specific action map is currently enabled.

GetActionMaps

Returns all action maps in the asset.

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

Last updated