docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct AffordanceStateData

    Struct to store affordance state data used to compute affordance transition tweens.

    Implements
    IEquatable<AffordanceStateData>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public readonly struct AffordanceStateData : IEquatable<AffordanceStateData>

    Constructors

    AffordanceStateData(byte, byte)

    Constructor for affordance state data.

    Declaration
    public AffordanceStateData(byte stateIndex, byte transitionIncrement)
    Parameters
    Type Name Description
    byte stateIndex

    State index reference.

    byte transitionIncrement

    Byte increment amount used for computing the float transition amount representation.

    AffordanceStateData(byte, float)

    Constructor for affordance state data.

    Declaration
    public AffordanceStateData(byte stateIndex, float transitionAmount)
    Parameters
    Type Name Description
    byte stateIndex

    State index reference.

    float transitionAmount

    Float representation of transition amount.

    Fields

    totalStateTransitionIncrements

    Total number of supported increments for the affordance state transition amount float conversion.

    Declaration
    public const byte totalStateTransitionIncrements = 255
    Field Value
    Type Description
    byte

    Properties

    stateIndex

    Affordance state index.

    Declaration
    public byte stateIndex { get; }
    Property Value
    Type Description
    byte

    stateTransitionAmountFloat

    0-1 Float representation of stateTransitionIncrement.

    Declaration
    public float stateTransitionAmountFloat { get; }
    Property Value
    Type Description
    float

    stateTransitionIncrement

    State transition amount represented as a byte. Converted to float by dividing over totalStateTransitionIncrements.

    Declaration
    public byte stateTransitionIncrement { get; }
    Property Value
    Type Description
    byte

    Methods

    Equals(object)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    Returns true if obj and this instance are the same type and represent the same value; otherwise, false.

    Overrides
    ValueType.Equals(object)

    Equals(AffordanceStateData)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(AffordanceStateData other)
    Parameters
    Type Name Description
    AffordanceStateData other

    An object to compare with this object.

    Returns
    Type Description
    bool

    Returns true if the current object is equal to the other parameter; otherwise, false.

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    Returns a 32-bit signed integer that is the hash code for this instance.

    Overrides
    ValueType.GetHashCode()

    Implements

    IEquatable<T>
    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)