Interface IInputActionManager
Defines the contract for the Scylla input action management subsystem.
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public interface IInputActionManager
Remarks
The action manager is the central hub for registering, querying, enabling,
and reading input actions across the entire input system. It bridges Unity's
InputAction and InputActionAsset types with Scylla's wrapper
types (ScyllaInputAction, ScyllaInputActionMap),
adding modifier-key disambiguation, per-frame state queries, and Scylla
Event eXchange (SEX) broadcasting on top of the raw Unity callbacks.
Actions can be registered either by supplying a Unity InputActionAsset
(which wraps every contained map and action automatically) or by registering
a hand-crafted ScyllaInputActionMap directly. Both paths support
the same query and control surface.
Actions are looked up by their ActionID, which normally matches the
action's name. When two actions from different maps share the same name, the
fully qualified form "MapID/ActionID" is used automatically to avoid
collisions. Always prefer TryGetAction(string, out ScyllaInputAction) over GetAction(string)
when action existence is uncertain.
The concrete implementation is InputActionManager. Access the
instance via ScyllaInput.Instance.Actions.
Properties
ActionCount
Gets the total number of actions registered across all maps.
Declaration
int ActionCount { get; }
Property Value
| Type | Description |
|---|---|
| int | A non-negative integer representing the sum of all actions in every registered
action map. When two actions from different maps share an |
ActionMapCount
Gets the total number of action maps currently registered with the manager.
Declaration
int ActionMapCount { get; }
Property Value
| Type | Description |
|---|---|
| int | A non-negative integer. Returns |
IsInitialized
Gets a value indicating whether the action manager has been initialized.
Declaration
bool IsInitialized { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Methods
DisableActionMap(string)
Disables the action map with the given ID, preventing its actions from receiving input events.
Declaration
void DisableActionMap(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The unique identifier of the action map to disable. An unrecognized ID is silently ignored. |
Remarks
Disabling a map that wraps a Unity InputActionMap calls
InputActionMap.Disable(). Disabling a manually-constructed map disables
each contained action individually. If the map is already disabled or the ID
is not found, the call is a no-op.
DisableAllActionMaps()
Disables every registered action map, preventing all actions from receiving input events.
Declaration
void DisableAllActionMaps()
Remarks
Calls Disable() on each registered map in registration order. Maps that are already disabled are silently skipped. This is useful for global pause states or UI-modal scenarios where all gameplay input should be suppressed at once.
EnableActionMap(string)
Enables the action map with the given ID, allowing its actions to receive input events.
Declaration
void EnableActionMap(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The unique identifier of the action map to enable. An unrecognized ID is silently ignored. |
Remarks
Enabling a map that wraps a Unity InputActionMap calls
InputActionMap.Enable(). Enabling a manually-constructed map enables
each contained action individually. If the map is already enabled or the ID
is not found, the call is a no-op.
EnableAllActionMaps()
Enables every registered action map, allowing all actions to receive input events.
Declaration
void EnableAllActionMaps()
Remarks
Calls Enable() on each registered map in registration order. Maps that are already enabled are silently skipped.
GetAction(string)
Returns the ScyllaInputAction registered under the given ID, or
null if no matching action exists.
Declaration
ScyllaInputAction GetAction(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The unique identifier of the action to retrieve. May be a plain action name
(e.g., |
Returns
| Type | Description |
|---|---|
| ScyllaInputAction | The matching ScyllaInputAction, or |
Remarks
The lookup first attempts an exact match against the internal dictionary. If the ID does not contain a slash and no exact match is found, the manager searches every registered map for an action with that name.
For unambiguous lookup of fully-qualified IDs, use the form
"MapID/ActionID". When action existence is uncertain, prefer
TryGetAction(string, out ScyllaInputAction) to avoid repeated null checks.
GetActionMap(string)
Returns the ScyllaInputActionMap registered under the given ID,
or null if not found.
Declaration
ScyllaInputActionMap GetActionMap(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The unique identifier of the action map to retrieve. A |
Returns
| Type | Description |
|---|---|
| ScyllaInputActionMap | The matching ScyllaInputActionMap, or |
GetActionValue(string)
Returns the current float value of the action identified by
actionID.
Declaration
float GetActionValue(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The ID of the action to query. A |
Returns
| Type | Description |
|---|---|
| float | The float value of the action, or |
Remarks
For actions with a Vector2 control type the returned value is the
magnitude of the 2D vector. For actions with a Vector3 control type
the returned value is the magnitude of the 3D vector. For all other control
types the raw float value is returned. See ReadFloat()
for the full type-dispatch logic.
GetActionVector2(string)
Returns the current Vector2 value of the action identified by
actionID.
Declaration
Vector2 GetActionVector2(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The ID of the action to query. A |
Returns
| Type | Description |
|---|---|
| Vector2 | The |
Remarks
Only actions whose control type is "Vector2" (or an unspecified type
that can be cast to Vector2) will yield meaningful results. Actions
with float/button/axis control types return Vector2.zero.
See ReadVector2() for the full type-dispatch
logic.
GetActionsInMap(string)
Returns a read-only list of all actions belonging to the specified action map.
Declaration
IReadOnlyList<ScyllaInputAction> GetActionsInMap(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The ID of the action map whose actions to retrieve. A |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<ScyllaInputAction> | A IReadOnlyList<T> of ScyllaInputAction objects belonging to the specified map, or Empty<T>() if the map was not found. |
GetAllActionMaps()
Returns a read-only list of all action maps currently registered with the manager.
Declaration
IReadOnlyList<ScyllaInputActionMap> GetAllActionMaps()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<ScyllaInputActionMap> | A IReadOnlyList<T> of all registered ScyllaInputActionMap
instances. Never |
GetAllActions()
Returns a read-only snapshot of all actions currently registered across all action maps.
Declaration
IReadOnlyList<ScyllaInputAction> GetAllActions()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<ScyllaInputAction> | A IReadOnlyList<T> of all registered ScyllaInputAction
instances. Never |
Remarks
The returned list is lazily rebuilt and cached. It is invalidated (and rebuilt on the next call) whenever an action is added or removed. Do not cache the returned reference across frames if actions may be added or removed dynamically.
HasActionMap(string)
Determines whether an action map with the given ID is currently registered.
Declaration
bool HasActionMap(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The action map ID to check. Case-sensitive. A |
Returns
| Type | Description |
|---|---|
| bool |
|
Initialize()
Initializes the action manager, preparing it to accept registrations and process input events.
Declaration
void Initialize()
Remarks
This method is called automatically by ScyllaInput during the module's
initialization phase. Calling it manually is not normally required. Subsequent
calls after the first successful initialization are no-ops.
IsActionMapEnabled(string)
Determines whether the action map with the given ID is currently enabled.
Declaration
bool IsActionMapEnabled(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The unique identifier of the action map to query. An unrecognized ID returns
|
Returns
| Type | Description |
|---|---|
| bool |
|
IsActionPressed(string)
Determines whether the action identified by actionID is
currently pressed or held down.
Declaration
bool IsActionPressed(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The ID of the action to query. A |
Returns
| Type | Description |
|---|---|
| bool |
|
RegisterActionAsset(InputActionAsset)
Registers all action maps and actions contained in a Unity
InputActionAsset, enabling them immediately.
Declaration
void RegisterActionAsset(InputActionAsset asset)
Parameters
| Type | Name | Description |
|---|---|---|
| InputActionAsset | asset | The Unity |
Remarks
Calling this method calls InputActionAsset.Enable() on the asset
and wraps each InputActionMap found inside it into a
ScyllaInputActionMap. Each action within those maps is in
turn wrapped into a ScyllaInputAction and registered.
If the asset is null or has already been registered, a warning is
logged and the call is a no-op.
RegisterActionMap(ScyllaInputActionMap)
Registers a hand-crafted ScyllaInputActionMap and all of its contained actions with the manager.
Declaration
void RegisterActionMap(ScyllaInputActionMap map)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaInputActionMap | map | The ScyllaInputActionMap to register. Must not be |
Remarks
Use this overload when building action maps programmatically instead of from a
Unity InputActionAsset. After registration, modifier disambiguation
metadata is recomputed for all currently registered actions.
If map is null or a map with the same
MapID is already registered, a warning is logged and the call is a
no-op.
Shutdown()
Shuts down the action manager, unsubscribing all event listeners, disposing all registered maps and actions, and resetting internal state.
Declaration
void Shutdown()
Remarks
After this method returns, IsInitialized is false and all
registered maps, actions, and cached data have been cleared. The manager must
be re-initialized via Initialize() before it can be used again.
This method is called automatically by ScyllaInput during module shutdown.
TryGetAction(string, out ScyllaInputAction)
Attempts to retrieve the ScyllaInputAction registered under the given ID.
Declaration
bool TryGetAction(string actionID, out ScyllaInputAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The unique identifier of the action to retrieve. A |
| ScyllaInputAction | action | When this method returns |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Internally delegates to GetAction(string). Prefer this overload over GetAction(string) when explicit existence checking is required, as it avoids separate null checks at the call site.
UnregisterActionAsset(InputActionAsset)
Removes all action maps and actions that were previously registered from the
given Unity InputActionAsset.
Declaration
void UnregisterActionAsset(InputActionAsset asset)
Parameters
| Type | Name | Description |
|---|---|---|
| InputActionAsset | asset | The Unity |
Remarks
Each action map that originated from asset is unregistered
by name. If the asset is null or was never registered, the call is a
no-op. The asset itself is not disabled or destroyed; only the Scylla-side
registrations are removed.
UnregisterActionMap(string)
Unregisters an action map and all of its actions, and disposes the map.
Declaration
void UnregisterActionMap(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The unique identifier of the action map to remove. Case-sensitive.
A |
Remarks
After removal, modifier disambiguation metadata is recomputed for all remaining
actions. If mapID is null, empty, or does not match
a registered map, the call is a no-op.
Update()
Advances the action manager state by one frame.
Declaration
void Update()
Remarks
Called automatically each frame by ScyllaInput. In the current
implementation, action state is driven entirely by Unity's event callbacks
rather than polling, so this method is reserved for future per-frame tracking
needs and performs no work in the default implementation.
WasActionCanceledThisFrame(string)
Determines whether the action identified by actionID was
canceled (button released) during the current frame.
Declaration
bool WasActionCanceledThisFrame(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The ID of the action to query. A |
Returns
| Type | Description |
|---|---|
| bool |
|
WasActionPerformedThisFrame(string)
Determines whether the action identified by actionID was
in the Performed phase at any point during the current frame.
Declaration
bool WasActionPerformedThisFrame(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The ID of the action to query. A |
Returns
| Type | Description |
|---|---|
| bool |
|
WasActionStartedThisFrame(string)
Determines whether the action identified by actionID was
in the Started phase (button pressed down) during the current frame.
Declaration
bool WasActionStartedThisFrame(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The ID of the action to query. A |
Returns
| Type | Description |
|---|---|
| bool |
|