Struct InteractionState
Serializable struct to hold logical input state for a given interaction, such as for select.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[Serializable]
public struct InteractionState
Remarks
Use of this class should be avoided outside of the context of playback and recording. Instead, use XRBaseInputInteractor.LogicalInputState when possible.
Properties
activatedThisFrame
Whether the interaction state activated this frame.
Declaration
public bool activatedThisFrame { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
active
Whether it is currently on.
Declaration
public bool active { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
deactivatedThisFrame
Whether the interaction state deactivated this frame.
Declaration
public bool deactivatedThisFrame { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
value
The value of the interaction in this frame.
Declaration
public float value { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
Methods
ResetFrameDependent()
Resets the interaction states that are based on whether they occurred "this frame".
Declaration
public void ResetFrameDependent()
See Also
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). |
See Also
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). |
See Also
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. |