docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class InputValue

    Wraps around values provided by input actions.

    Inheritance
    object
    InputValue
    Namespace: UnityEngine.InputSystem
    Assembly: Unity.InputSystem.dll
    Syntax
    public class InputValue
    Remarks

    This is a wrapper around InputAction.CallbackContext chiefly for use with GameObject messages (i.e. SendMessage(string, object)). It exists so that action callback data can be represented as an object, can be reused, and shields the receiver from having to know about action callback specifics.

    Properties

    isPressed

    Declaration
    public bool isPressed { get; }
    Property Value
    Type Description
    bool
    See Also
    InputAction

    Methods

    Get()

    Read the value as an object.

    Declaration
    public object Get()
    Returns
    Type Description
    object

    The current value in the form of a boxed object.

    Remarks

    This method allocates GC memory and will thus created garbage. If used during gameplay, it will lead to GC spikes.

    See Also
    InputAction

    Get<TValue>()

    Declaration
    public TValue Get<TValue>() where TValue : struct
    Returns
    Type Description
    TValue
    Type Parameters
    Name Description
    TValue
    See Also
    InputAction

    See Also

    InputAction
    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)