Class InputActionReference | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class InputActionReference

    References a specific InputAction in an InputActionMap stored inside an InputActionAsset.

    Inheritance
    System.Object
    InputActionReference
    Namespace: UnityEngine.Experimental.Input
    Syntax
    public class InputActionReference : ScriptableObject
    Remarks

    The difference to a plain reference directly to an InputAction object is that an InputActionReference can be serialized without causing the referenced InputAction to be serialized as well. The reference will remain intact even if the action or the map that contains the action is renamed.

    References can be set up graphically in the editor by dropping individual actions from the project browser onto a reference field.

    Properties

    action

    The action that the reference resolves to.

    Declaration
    public InputAction action { get; }
    Property Value
    Type Description
    InputAction
    Remarks

    Actions are resolved on demand based on their internally stored IDs.

    asset

    The asset that the referenced action is part of.

    Declaration
    public InputActionAsset asset { get; }
    Property Value
    Type Description
    InputActionAsset

    Methods

    Set(InputAction)

    Declaration
    public void Set(InputAction action)
    Parameters
    Type Name Description
    InputAction action

    Set(InputActionAsset, String, String)

    Declaration
    public void Set(InputActionAsset asset, string mapName, string actionName)
    Parameters
    Type Name Description
    InputActionAsset asset
    System.String mapName
    System.String actionName

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    Operators

    Implicit(InputActionReference to InputAction)

    Declaration
    public static implicit operator InputAction(InputActionReference reference)
    Parameters
    Type Name Description
    InputActionReference reference
    Returns
    Type Description
    InputAction
    In This Article
    • Properties
      • action
      • asset
    • Methods
      • Set(InputAction)
      • Set(InputActionAsset, String, String)
      • ToString()
    • Operators
      • Implicit(InputActionReference to InputAction)
    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