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 : ParagonBehaviourInherits: ParagonBehaviour → SerializedMonoBehaviour → MonoBehaviour
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:
Enables the entire
InputActionAssetIterates 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
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:
Resolves the
InputActionMapfrom the assetDiscovers
[InputActionCallback]methods via reflectionSubscribes wrapped callbacks to the appropriate input action phases
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.
nameOrId
string
Action map name or GUID
Returns: The matching InputActionMap.
Calls FindActionMap(nameOrId, throwIfNotFound: true). Throws ArgumentException if the action map does not exist in the asset.
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
Asset must be assigned
Calling Enable() or any action map method without an assigned InputActionAsset will throw a NullReferenceException. Check HasAsset first if the asset may not be configured.
Enable vs EnableActionMap
Enable() enables the entire asset and binds all handlers. EnableActionMap() only enables one action map without binding callbacks. For full functionality, use Enable() at startup and EnableActionMap()/DisableActionMap() for selective control afterward.
See Also
InputActionMapBinding — abstract base for binding handlers
InputActionPhase — phase enum
Input System — system overview
Last updated