Language
Edit

SpeechInteractor Class

Definition

[UnityEngine.AddComponentMenu("MRTK/Input/Speech Interactor")]
public class SpeechInteractor : UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor, MixedReality.Toolkit.ISpeechInteractor
[<UnityEngine.AddComponentMenu("MRTK/Input/Speech Interactor")>]
type SpeechInteractor = class
    inherit XRBaseInteractor
    interface ISpeechInteractor
    interface IXRInteractor
Public Class SpeechInteractor
Inherits XRBaseInteractor
Implements ISpeechInteractor
Inheritance
UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor
SpeechInteractor
Attributes
UnityEngine.AddComponentMenuAttribute
Implements
ISpeechInteractor UnityEngine.XR.Interaction.Toolkit.IXRInteractor

Remarks

All StatefulInteractable objects register themselves with this interactor so to receive events when the associated keyword is heard by a IKeywordRecognitionSubsystem.
At the time SpeechInteractor was created Unity's XRI did not support selecting more than one interactable at a time. Because of this limitation, the SpeechInteractor drops part of the selection lifecycle management provided by Unity's XRI and manually informs the interaction manager to enter and exit selection states.

Constructors

Name Description
SpeechInteractor()

Properties

Name Description
VoiceCommandTriggerTime

How long does the interactor remain selecting the interactable after recognizing a voice command?

Methods

Name Description
GetValidTargets(List<IXRInteractable>) UnityEngine.XR.Interaction.Toolkit.IXRInteractor.GetValidTargets(System.Collections.Generic.List{UnityEngine.XR.Interaction.Toolkit.IXRInteractable})
OnInteractableRegistered(InteractableRegisteredEventArgs)

This function should be called when a new UnityEngine.XR.Interaction.Toolkit.IXRInteractable is added to the UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor.interactionManager.

OnInteractableUnregistered(InteractableUnregisteredEventArgs)

This function should be called when a new UnityEngine.XR.Interaction.Toolkit.IXRInteractable is removed from the UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor.interactionManager.

OnRegistered(InteractorRegisteredEventArgs) UnityEngine.XR.Interaction.Toolkit.IXRInteractor.OnRegistered(UnityEngine.XR.Interaction.Toolkit.InteractorRegisteredEventArgs)
OnSelectExiting(SelectExitEventArgs) UnityEngine.XR.Interaction.Toolkit.XRBaseInteractor.OnSelectExiting(UnityEngine.XR.Interaction.Toolkit.SelectExitEventArgs)
OnUnregistered(InteractorUnregisteredEventArgs) UnityEngine.XR.Interaction.Toolkit.IXRInteractor.OnUnregistered(UnityEngine.XR.Interaction.Toolkit.InteractorUnregisteredEventArgs)
ProcessInteractor(XRInteractionUpdateOrder+UpdatePhase) UnityEngine.XR.Interaction.Toolkit.IXRInteractor.ProcessInteractor(UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder.UpdatePhase)
RegisterInteractable(StatefulInteractable, String)

Register a new StatefulInteractable and an associated keyword with this SpeechInteractor.

UnregisterInteractable(StatefulInteractable, String)

Remove an existing StatefulInteractable and keyword from this SpeechInteractor.

Applies to