StatefulInteractable Class

Definition

An extended version of MRTKBaseInteractable that adds additional functionality such as speech support, gaze support, and toggle behaviors.

C#
[UnityEngine.AddComponentMenu("MRTK/Core/Stateful Interactable")]
public class StatefulInteractable : MixedReality.Toolkit.MRTKBaseInteractable
Inheritance
UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable
StatefulInteractable
Derived
Attributes
UnityEngine.AddComponentMenuAttribute

Constructors

Properties

AllowSelectByVoice

Does the interactable allow triggering select via a voice command? If true, voice command can be used to trigger "select" on the interactable

DeselectThreshold

The threshold of selection progress at which the interactable will be deselected.

FarDwellTime

Time required for far ray dwell

GazeDwellTime

Time required for gaze dwell

HoveringGazeInteractors

(Read Only) The list of IGazeInteractor components currently gazing this object.

(Inherited from MRTKBaseInteractable)
HoveringGazePinchInteractors

(Read Only) The list of IGazePinchInteractor components currently hovering this object.

(Inherited from MRTKBaseInteractable)
HoveringGrabInteractors

(Read Only) The list of IGrabInteractor components currently hovering this object.

(Inherited from MRTKBaseInteractable)
HoveringPokeInteractors

(Read Only) The list of IPokeInteractor components currently hovering this object.

(Inherited from MRTKBaseInteractable)
HoveringRayInteractors

(Read Only) The list of IRayInteractor components currently hovering this object.

(Inherited from MRTKBaseInteractable)
IsActiveHovered

Is this object hovered by any interactor other than passive targeting interactors?

(Inherited from MRTKBaseInteractable)
IsGazeHovered

Is this object hovered by any gaze interactor?

(Inherited from MRTKBaseInteractable)
IsGazePinchHovered

Is this object hovered by a gaze-pinch interactor?

(Inherited from MRTKBaseInteractable)
IsGazePinchSelected

Is this object selected by a gaze-pinch interactor?

(Inherited from MRTKBaseInteractable)
IsGrabHovered

Is this object hovered by a grab interactor?

(Inherited from MRTKBaseInteractable)
IsGrabSelected

Is this object selected by a grab interactor?

(Inherited from MRTKBaseInteractable)
IsPokeHovered

Is this object hovered by a near touch/poke interactor?

(Inherited from MRTKBaseInteractable)
IsPokeSelected

Is this object selected by a poke interactor?

(Inherited from MRTKBaseInteractable)
IsRayHovered

Is this object hovered by a non-gaze ray interactor?

(Inherited from MRTKBaseInteractable)
IsRaySelected

Is this object selected by a non-gaze ray interactor?

(Inherited from MRTKBaseInteractable)
IsToggled

Is the interactable toggled?

OnClicked

Fired when the interactable is fully clicked (select + deselect)

OnDisabled

Fired when the interactable is disabled

OnEnabled

Fired when the interactable is enabled

SelectingGazePinchInteractors

(Read Only) The list of IGazePinchInteractor components currently selecting this object.

(Inherited from MRTKBaseInteractable)
SelectingGrabInteractors

(Read Only) The list of IGrabInteractor components currently selecting this object.

(Inherited from MRTKBaseInteractable)
SelectRequiresHover

Does the interactable require the interactor to hover over it? If true, then the OnClick event will only get fired while this Interactable is being hovered.

SelectThreshold

The threshold of selection progress at which the interactable will be selected.

SpeechRecognitionKeyword

Speech keyword required for triggering "select" on the interactable

ToggleMode

The toggle behavior of the interactable. Set OneWayToggle for radio buttons.

TriggerOnRelease

Should the user be required to fully select and deselect the interactable for Click and Toggle to fire?

UseFarDwell

Should hovering the object with a far ray for a certain amount of time select it?

UseGazeDwell

Should gazing at the object for a certain amount of time select it?

VoiceRequiresFocus

Does the voice command require this to have focus? If true, then the voice command will only respond to voice commands while this Interactable has focus.

Methods

Awake()

A Unity event function that is called when an enabled script instance is being loaded.

CanClickOnFirstSelectEntered(SelectEnterEventArgs)

This function determines whether the interactable should fire a click event at a given select event. Subclasses can override this to add additional requirements for full click/toggle activation, such as roll-off prevention.

CanClickOnLastSelectExited(SelectExitEventArgs)

This function determines whether the interactable should fire a click event at a given deselect event. Subclasses can override this to add additional requirements for full click/toggle activation, such as roll-off prevention.

DisableInteractorType(SystemInterfaceType)

Adds the specified type to the set of interactors which cannot select this interactable

(Inherited from MRTKBaseInteractable)
EnableInteractorType(SystemInterfaceType)

Removes the specified type to the set of interactors which cannot select this interactable

(Inherited from MRTKBaseInteractable)
ForceSetToggled(Boolean, Boolean)

Forcibly toggle the interactable.

ForceSetToggled(Boolean)

Forcibly toggle the interactable and fire the relevant events. This is a single-arg overload for ForceSetToggled for use with UnityEvents. Consider using ForceSetToggled(bool, bool) instead, especially if you'd like to suppress the resulting toggle events.

GetSelectionProgress()

Get the current selection progress of this StatefulInteractable.

IsHoverableBy(IXRHoverInteractor) (Inherited from MRTKBaseInteractable)
IsInteractorTypeValid(IXRInteractor)

Is the given type of interactor permitted to interact with this interactable?

(Inherited from MRTKBaseInteractable)
IsSelectableBy(IXRSelectInteractor) (Inherited from MRTKBaseInteractable)
OnDestroy()

A Unity event function that is called when the script component has been destroyed.

OnDisable()

A Unity event function that is called when the script component has been disabled.

OnEnable()

A Unity event function that is called when the script component has been enabled.

OnFirstSelectEntered(SelectEnterEventArgs) UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable.OnFirstSelectEntered(UnityEngine.XR.Interaction.Toolkit.SelectEnterEventArgs)
OnHoverEntering(HoverEnterEventArgs) (Inherited from MRTKBaseInteractable)
OnHoverExiting(HoverExitEventArgs) (Inherited from MRTKBaseInteractable)
OnLastSelectExited(SelectExitEventArgs) UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable.OnLastSelectExited(UnityEngine.XR.Interaction.Toolkit.SelectExitEventArgs)
OnSelectEntering(SelectEnterEventArgs) (Inherited from MRTKBaseInteractable)
OnSelectExiting(SelectExitEventArgs) (Inherited from MRTKBaseInteractable)

Applies to

Proizvod Verzije
MRTK3 Core Definitions 3.0, 3.1, 3.2