docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IInputActionCollection

    A collection of input actions (see InputAction).

    Inherited Members
    IEnumerable<InputAction>.GetEnumerator()
    Namespace: UnityEngine.InputSystem
    Assembly: Unity.InputSystem.dll
    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
    InputBinding?
    Remarks

    If this is not null, only bindings that match the mask will be used.

    Modifying this property while any of the actions in the collection are enabled will lead to the actions getting disabled temporarily and then re-enabled.

    See Also
    InputActionMap
    InputActionAsset

    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.

    See Also
    InputActionMap
    InputActionAsset

    devices

    Devices to use with the actions in this collection.

    Declaration
    ReadOnlyArray<InputDevice>? devices { get; set; }
    Property Value
    Type Description
    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.

    Modifying this property after bindings in the collection have already been resolved, will lead to controls getting refreshed. If any of the actions in the collection are currently in progress (see phase), the actions will remain unaffected and in progress except if the controls currently driving them (see activeControl) are no longer part of any of the selected devices. In that case, the action is canceled.

    See Also
    InputActionMap
    InputActionAsset

    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
    bool

    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.

    See Also
    InputActionMap
    InputActionAsset

    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
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)