Interface IInputActionCollection
A collection of input actions (InputAction).
Namespace: UnityEngine.InputSystem
Syntax
public interface IInputActionCollection : IEnumerable<InputAction>, IEnumerable
Properties
bindingMask
Optional mask applied to all bindings in the collection.
Declaration
InputBinding? bindingMask { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<InputBinding> |
Remarks
If this is not null, only bindings that match the mask will be used.
controlSchemes
List of control schemes defined for the set of actions.
Declaration
ReadOnlyArray<InputControlScheme> controlSchemes { get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<InputControlScheme> |
Remarks
Control schemes are optional and the list may be empty.
devices
Devices to use with the actions in this collection.
Declaration
ReadOnlyArray<InputDevice>? devices { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<ReadOnlyArray<InputDevice>> |
Remarks
If this is set, actions in the collection will exclusively bind to devices in the given list. For example, if two gamepads are present in the system yet only one gamepad is listed here, then a "<Gamepad>/leftStick" binding will only bind to the gamepad in the list and not to the one that is only available globally.
Methods
Contains(InputAction)
Check whether the given action is contained in this collection.
Declaration
bool Contains(InputAction action)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action | An arbitrary input action. |
Returns
Type | Description |
---|---|
System.Boolean | True if the given action is contained in the collection, false if not. |
Remarks
Calling this method will not allocate GC memory (unlike when iterating generically over the collection). Also, a collection may have a faster containment check rather than having to search through all its actions.
Disable()
Disable all actions in the collection.
Declaration
void Disable()
Enable()
Enable all actions in the collection.
Declaration
void Enable()