docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct InteractionState

    InteractionState type to hold current state for a given interaction.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [Serializable]
    public struct InteractionState

    Properties

    activatedThisFrame

    Whether the interaction state activated this frame.

    Declaration
    public bool activatedThisFrame { get; set; }
    Property Value
    Type Description
    bool

    active

    Whether it is currently on.

    Declaration
    public bool active { get; set; }
    Property Value
    Type Description
    bool

    deactivatedThisFrame

    Whether the interaction state deactivated this frame.

    Declaration
    public bool deactivatedThisFrame { get; set; }
    Property Value
    Type Description
    bool

    value

    The value of the interaction in this frame.

    Declaration
    public float value { get; set; }
    Property Value
    Type Description
    float

    Methods

    ResetFrameDependent()

    Resets the interaction states that are based on whether they occurred "this frame".

    Declaration
    public void ResetFrameDependent()
    See Also
    activatedThisFrame
    deactivatedThisFrame

    SetFrameDependent(bool)

    Sets the interaction state that are based on whether they occurred "this frame".

    Declaration
    public void SetFrameDependent(bool wasActive)
    Parameters
    Type Name Description
    bool wasActive

    Whether the previous state is active (in other words, pressed).

    SetFrameState(bool)

    Sets the interaction state for this frame. This method should only be called once per frame.

    Declaration
    public void SetFrameState(bool isActive)
    Parameters
    Type Name Description
    bool isActive

    Whether the state is active (in other words, pressed).

    SetFrameState(bool, float)

    Sets the interaction state for this frame. This method should only be called once per frame.

    Declaration
    public void SetFrameState(bool isActive, float newValue)
    Parameters
    Type Name Description
    bool isActive

    Whether the state is active (in other words, pressed).

    float newValue

    The interaction value.

    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)