Struct AffordanceStateData
Struct to store affordance state data used to compute affordance transition tweens.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State
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, Single)
Constructor for affordance state data.
Declaration
public AffordanceStateData(byte stateIndex, float transitionAmount)
Parameters
Type | Name | Description |
---|---|---|
Byte | stateIndex | State index reference. |
Single | 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 readonly byte stateIndex { get; }
Property Value
Type | Description |
---|---|
Byte |
stateTransitionAmountFloat
0-1 Float representation of stateTransitionIncrement.
Declaration
public readonly float stateTransitionAmountFloat { get; }
Property Value
Type | Description |
---|---|
Single |
stateTransitionIncrement
State transition amount represented as a byte. Converted to float by dividing over totalStateTransitionIncrements.
Declaration
public readonly byte stateTransitionIncrement { get; }
Property Value
Type | Description |
---|---|
Byte |
Methods
Equals(Object)
Indicates whether this instance and a specified object are equal.
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
Boolean | Returns true if |
Overrides
Equals(AffordanceStateData)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(AffordanceStateData other)
Parameters
Type | Name | Description |
---|---|---|
AffordanceStateData | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the current object is equal to the |
Implements
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Returns a 32-bit signed integer that is the hash code for this instance. |