docs.unity3d.com
    Show / Hide Table of Contents

    Interface IInputActionCollection

    A collection of input actions (see InputAction).

    Namespace: UnityEngine.InputSystem
    Syntax
    public interface IInputActionCollection : IEnumerable<InputAction>

    Properties

    bindingMask

    Optional mask applied to all bindings in the collection.

    Declaration
    InputBinding? bindingMask { get; set; }
    Property Value
    Type Description
    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
    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
    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()
    See Also
    Disable()
    enabled

    Enable()

    Enable all actions in the collection.

    Declaration
    void Enable()
    See Also
    Enable()
    enabled

    See Also

    InputActionMap
    InputActionAsset
    In This Article
    • Properties
      • bindingMask
      • controlSchemes
      • devices
    • Methods
      • Contains(InputAction)
      • Disable()
      • Enable()
    • See Also
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023