Class ScyllaInputActionMap
A named, enable/disable-capable container for a logically related set of
ScyllaInputAction objects, corresponding to a single Unity
InputActionMap.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public class ScyllaInputActionMap
Remarks
An action map groups actions that belong to the same gameplay context
(e.g., "Gameplay", "UI", "Vehicle"). Only one or a few
maps are typically enabled at any given time, preventing unintended input
cross-talk between contexts.
Construction paths:
-
ScyllaInputActionMap(InputActionMap) - wraps an existing
Unity
InputActionMap, creating a ScyllaInputAction for every action it contains. Used internally when anInputActionAssetis registered via RegisterActionAsset(InputActionAsset). - ScyllaInputActionMap(string, string) - creates an empty map with no underlying Unity map. Actions are added manually via AddAction(ScyllaInputAction). Used when building maps programmatically.
Enable/Disable behaviour: Enabling or disabling a map that wraps a Unity
InputActionMap delegates to InputActionMap.Enable() /
InputActionMap.Disable(), which is the most efficient path. For
manually-constructed maps (where UnityMap is null), each
contained action is enabled or disabled individually.
Action map instances are owned by InputActionManager. Do not dispose an instance that has been registered with the manager; call UnregisterActionMap(string) instead.
Constructors
ScyllaInputActionMap(string, string)
Initializes a new, empty ScyllaInputActionMap with the specified ID and optional display name.
Declaration
public ScyllaInputActionMap(string mapID, string displayName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The unique identifier for this map. Used as both the lookup key in
InputActionManager and as the DisplayName if no
separate display name is provided. Must not be |
| string | displayName | Optional human-readable display name. Defaults to |
Remarks
Use this constructor when building action maps programmatically rather than
from a Unity asset. Actions must be added individually via
AddAction(ScyllaInputAction). UnityMap will be null for maps
created this way.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
ScyllaInputActionMap(InputActionMap)
Initializes a new ScyllaInputActionMap by wrapping an existing
Unity InputActionMap and creating a ScyllaInputAction for
every action it contains.
Declaration
public ScyllaInputActionMap(InputActionMap unityMap)
Parameters
| Type | Name | Description |
|---|---|---|
| InputActionMap | unityMap | The Unity |
Remarks
The IsEnabled state is initialized from
InputActionMap.enabled at construction time. Actions are wrapped and
added in the order Unity reports them. Called internally by
RegisterActionAsset(InputActionAsset).
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
Properties
ActionCount
Gets the total number of actions currently contained in this map.
Declaration
public int ActionCount { get; }
Property Value
| Type | Description |
|---|---|
| int | A non-negative integer. |
Actions
Gets the read-only list of all actions contained in this map.
Declaration
public IReadOnlyList<ScyllaInputAction> Actions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<ScyllaInputAction> | Never |
DisplayName
Gets the human-readable display name for this action map.
Declaration
public string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string | Defaults to the same value as MapID. When constructed
programmatically a separate |
IsEnabled
Gets a value indicating whether this action map is currently enabled.
Declaration
public bool IsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
MapID
Gets the unique string identifier for this action map.
Declaration
public string MapID { get; }
Property Value
| Type | Description |
|---|---|
| string | When constructed from a Unity |
UnityMap
Gets the underlying Unity InputActionMap, or null if this map
was created programmatically via the string constructor.
Declaration
public InputActionMap UnityMap { get; }
Property Value
| Type | Description |
|---|---|
| InputActionMap | Non- |
Methods
AddAction(ScyllaInputAction)
Adds a ScyllaInputAction to this map and subscribes to its events so that they are relayed through OnActionPerformed, OnActionStarted, and OnActionCanceled.
Declaration
public void AddAction(ScyllaInputAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaInputAction | action | The ScyllaInputAction to add. A |
Remarks
If action is null, or an action with the same
ActionID already exists in this map, the call is a silent no-op.
Actions are stored in the order they are added.
Disable()
Disables this action map, preventing all contained actions from receiving input events, and raises OnDisabled.
Declaration
public void Disable()
Remarks
For maps backed by a Unity InputActionMap, calls
InputActionMap.Disable() on the underlying Unity map.
For programmatically-constructed maps, calls Disable() on each contained action individually.
If the map is already disabled, this method is a no-op and OnDisabled is not raised again.
Enable()
Enables this action map, allowing all contained actions to receive input events, and raises OnEnabled.
Declaration
public void Enable()
Remarks
For maps backed by a Unity InputActionMap (i.e., UnityMap
is non-null), calls InputActionMap.Enable() on the underlying
Unity map, which is the most efficient path.
For programmatically-constructed maps (UnityMap is null),
calls Enable() on each contained action
individually.
If the map is already enabled, this method is a no-op and OnEnabled is not raised again.
GetAction(string)
Returns the ScyllaInputAction registered under the given ID,
or null if no matching action exists in this map.
Declaration
public ScyllaInputAction GetAction(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The |
Returns
| Type | Description |
|---|---|
| ScyllaInputAction | The matching ScyllaInputAction, or |
HasAction(string)
Determines whether an action with the given ID exists in this map.
Declaration
public bool HasAction(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The |
Returns
| Type | Description |
|---|---|
| bool |
|
RemoveAction(string)
Removes the action with the specified ID from this map and unsubscribes from its events.
Declaration
public bool RemoveAction(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
The removed action is not disposed; only the event subscription and the internal collection membership are revoked. This method does not trigger modifier disambiguation recomputation; the caller (InputActionManager) is responsible for doing so after removing actions.
ToString()
Returns a human-readable string representation of this action map, including its map ID, display name, action count, and enabled state.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string in the form
|
Overrides
TryGetAction(string, out ScyllaInputAction)
Attempts to retrieve the ScyllaInputAction registered under the given ID.
Declaration
public bool TryGetAction(string actionID, out ScyllaInputAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The |
| ScyllaInputAction | action | When this method returns |
Returns
| Type | Description |
|---|---|
| bool |
|
Events
OnActionCanceled
Raised when any action in this map fires its OnCanceled event.
Declaration
public event Action<ScyllaInputAction> OnActionCanceled
Event Type
| Type | Description |
|---|---|
| Action<ScyllaInputAction> |
Remarks
Never suppressed by modifier disambiguation; always propagates to allow subscribers to reset pressed/held state.
OnActionPerformed
Raised when any action in this map fires its OnPerformed event.
Declaration
public event Action<ScyllaInputAction> OnActionPerformed
Event Type
| Type | Description |
|---|---|
| Action<ScyllaInputAction> |
Remarks
The event is subject to the same modifier-disambiguation suppression rules as the originating action. InputActionManager subscribes to this event to relay the notification up to OnActionPerformed and to the SEX event bus.
OnActionStarted
Raised when any action in this map fires its OnStarted event.
Declaration
public event Action<ScyllaInputAction> OnActionStarted
Event Type
| Type | Description |
|---|---|
| Action<ScyllaInputAction> |
Remarks
Subject to modifier-disambiguation suppression. See OnStarted for details.
OnDisabled
Raised immediately after this map is disabled via Disable().
Declaration
public event Action<ScyllaInputActionMap> OnDisabled
Event Type
| Type | Description |
|---|---|
| Action<ScyllaInputActionMap> |
Remarks
InputActionManager subscribes to this event to forward the notification to OnActionMapDisabled and to emit a log entry.
OnEnabled
Raised immediately after this map is enabled via Enable().
Declaration
public event Action<ScyllaInputActionMap> OnEnabled
Event Type
| Type | Description |
|---|---|
| Action<ScyllaInputActionMap> |
Remarks
InputActionManager subscribes to this event to forward the notification to OnActionMapEnabled and to emit a log entry.