docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IXRInputButtonReader

    Interface which allows for callers to read the button's state from an input source.

    Inherited Members
    IXRInputValueReader<float>.ReadValue()
    IXRInputValueReader<float>.TryReadValue(out float)
    Namespace: UnityEngine.XR.Interaction.Toolkit.Inputs.Readers
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public interface IXRInputButtonReader : IXRInputValueReader<float>, IXRInputValueReader

    Methods

    ReadIsPerformed()

    Read whether the button is currently performed, which typically means whether the button is being pressed. This is typically true for multiple frames.

    Declaration
    bool ReadIsPerformed()
    Returns
    Type Description
    bool

    Returns true if the button is performed. Otherwise, returns false.

    Remarks

    For input actions, this depends directly on the interaction(s) driving the action (including the default interaction if no specific interaction has been added to the action or binding).

    See Also
    XRInputButtonReader

    ReadWasCompletedThisFrame()

    Read whether the button completed this frame, which typically means whether the button stopped being pressed during this frame. This is typically only true for one single frame.

    Declaration
    bool ReadWasCompletedThisFrame()
    Returns
    Type Description
    bool

    Returns true if the button completed this frame. Otherwise, returns false.

    Remarks

    For input actions, this depends directly on the interaction(s) driving the action (including the default interaction if no specific interaction has been added to the action or binding).

    See Also
    XRInputButtonReader

    ReadWasPerformedThisFrame()

    Read whether the button performed this frame, which typically means whether the button started being pressed during this frame. This is typically only true for one single frame.

    Declaration
    bool ReadWasPerformedThisFrame()
    Returns
    Type Description
    bool

    Returns true if the button performed this frame. Otherwise, returns false.

    Remarks

    For input actions, this depends directly on the interaction(s) driving the action (including the default interaction if no specific interaction has been added to the action or binding).

    See Also
    XRInputButtonReader

    See Also

    XRInputButtonReader
    In This Article
    Back to top
    Copyright © 2025 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)