Struct AffordanceStateData
Struct to store affordance state data used to compute affordance transition tweens.
Implements
Inherited Members
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 |
Overrides
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 |
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. |