docs.unity3d.com
    Show / Hide Table of Contents

    Class XRBaseControllerInteractor

    Abstract base class from which all interactors that are controller-driven derive. This class hooks into the interaction system (via XRInteractionManager) and provides base virtual methods for handling hover and selection. Additionally, this class provides functionality for checking the controller's selection status and hiding the controller on selection.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    XRBaseInteractor
    XRBaseControllerInteractor
    XRDirectInteractor
    XRRayInteractor
    Inherited Members
    XRBaseInteractor.registered
    XRBaseInteractor.unregistered
    XRBaseInteractor.interactionManager
    XRBaseInteractor.interactionLayers
    XRBaseInteractor.attachTransform
    XRBaseInteractor.keepSelectedTargetValid
    XRBaseInteractor.startingSelectedInteractable
    XRBaseInteractor.startingTargetFilter
    XRBaseInteractor.hoverEntered
    XRBaseInteractor.hoverExited
    XRBaseInteractor.selectEntered
    XRBaseInteractor.selectExited
    XRBaseInteractor.targetFilter
    XRBaseInteractor.allowHover
    XRBaseInteractor.allowSelect
    XRBaseInteractor.isPerformingManualInteraction
    XRBaseInteractor.interactablesHovered
    XRBaseInteractor.hasHover
    XRBaseInteractor.interactablesSelected
    XRBaseInteractor.firstInteractableSelected
    XRBaseInteractor.hasSelection
    XRBaseInteractor.Reset()
    XRBaseInteractor.OnEnable()
    XRBaseInteractor.OnDisable()
    XRBaseInteractor.Start()
    XRBaseInteractor.OnDestroy()
    XRBaseInteractor.GetAttachTransform(IXRInteractable)
    XRBaseInteractor.GetAttachPoseOnSelect(IXRSelectInteractable)
    XRBaseInteractor.GetLocalAttachPoseOnSelect(IXRSelectInteractable)
    XRBaseInteractor.GetValidTargets(List<IXRInteractable>)
    XRBaseInteractor.isHoverActive
    XRBaseInteractor.CanHover(IXRHoverInteractable)
    XRBaseInteractor.CanSelect(IXRSelectInteractable)
    XRBaseInteractor.IsHovering(IXRHoverInteractable)
    XRBaseInteractor.IsSelecting(IXRSelectInteractable)
    XRBaseInteractor.IsHovering(IXRInteractable)
    XRBaseInteractor.IsSelecting(IXRInteractable)
    XRBaseInteractor.selectedInteractableMovementTypeOverride
    XRBaseInteractor.CaptureAttachPose(IXRSelectInteractable)
    XRBaseInteractor.IXRInteractor.OnRegistered(InteractorRegisteredEventArgs)
    XRBaseInteractor.IXRInteractor.OnUnregistered(InteractorUnregisteredEventArgs)
    XRBaseInteractor.IXRHoverInteractor.CanHover(IXRHoverInteractable)
    XRBaseInteractor.IXRHoverInteractor.OnHoverEntering(HoverEnterEventArgs)
    XRBaseInteractor.IXRHoverInteractor.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractor.IXRHoverInteractor.OnHoverExiting(HoverExitEventArgs)
    XRBaseInteractor.IXRHoverInteractor.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractor.IXRSelectInteractor.CanSelect(IXRSelectInteractable)
    XRBaseInteractor.IXRSelectInteractor.OnSelectEntering(SelectEnterEventArgs)
    XRBaseInteractor.IXRSelectInteractor.OnSelectEntered(SelectEnterEventArgs)
    XRBaseInteractor.IXRSelectInteractor.OnSelectExiting(SelectExitEventArgs)
    XRBaseInteractor.IXRSelectInteractor.OnSelectExited(SelectExitEventArgs)
    XRBaseInteractor.OnRegistered(InteractorRegisteredEventArgs)
    XRBaseInteractor.OnUnregistered(InteractorUnregisteredEventArgs)
    XRBaseInteractor.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractor.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractor.OnSelectEntered(SelectEnterEventArgs)
    XRBaseInteractor.OnSelectExited(SelectExitEventArgs)
    XRBaseInteractor.StartManualInteraction(IXRSelectInteractable)
    XRBaseInteractor.EndManualInteraction()
    XRBaseInteractor.interactionLayerMask
    XRBaseInteractor.enableInteractions
    XRBaseInteractor.onHoverEntered
    XRBaseInteractor.onHoverExited
    XRBaseInteractor.onSelectEntered
    XRBaseInteractor.onSelectExited
    XRBaseInteractor.onHoverEnter
    XRBaseInteractor.onHoverExit
    XRBaseInteractor.onSelectEnter
    XRBaseInteractor.onSelectExit
    XRBaseInteractor.OnHoverEntering(XRBaseInteractable)
    XRBaseInteractor.OnHoverEntered(XRBaseInteractable)
    XRBaseInteractor.OnHoverExiting(XRBaseInteractable)
    XRBaseInteractor.OnHoverExited(XRBaseInteractable)
    XRBaseInteractor.OnSelectEntering(XRBaseInteractable)
    XRBaseInteractor.OnSelectEntered(XRBaseInteractable)
    XRBaseInteractor.OnSelectExiting(XRBaseInteractable)
    XRBaseInteractor.OnSelectExited(XRBaseInteractable)
    XRBaseInteractor.selectTarget
    XRBaseInteractor.hoverTargets
    XRBaseInteractor.GetHoverTargets(List<XRBaseInteractable>)
    XRBaseInteractor.GetValidTargets(List<XRBaseInteractable>)
    XRBaseInteractor.CanHover(XRBaseInteractable)
    XRBaseInteractor.CanSelect(XRBaseInteractable)
    XRBaseInteractor.requireSelectExclusive
    XRBaseInteractor.StartManualInteraction(XRBaseInteractable)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(String)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(Object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    Component.SendMessageUpwards(String, Object, SendMessageOptions)
    Component.SendMessageUpwards(String, Object)
    Component.SendMessageUpwards(String)
    Component.SendMessageUpwards(String, SendMessageOptions)
    Component.SendMessage(String, Object)
    Component.SendMessage(String)
    Component.SendMessage(String, Object, SendMessageOptions)
    Component.SendMessage(String, SendMessageOptions)
    Component.BroadcastMessage(String, Object, SendMessageOptions)
    Component.BroadcastMessage(String, Object)
    Component.BroadcastMessage(String)
    Component.BroadcastMessage(String, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Component.rigidbody
    Component.rigidbody2D
    Component.camera
    Component.light
    Component.animation
    Component.constantForce
    Component.renderer
    Component.audio
    Component.networkView
    Component.collider
    Component.collider2D
    Component.hingeJoint
    Component.particleSystem
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public abstract class XRBaseControllerInteractor : XRBaseInteractor, IXRHoverInteractor, IXRSelectInteractor, IXRActivateInteractor, IXRInteractor

    Properties

    allowActivate

    Defines whether this interactor allows sending activate and deactivate events.

    Declaration
    public bool allowActivate { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    allowHoveredActivate
    shouldActivate
    shouldDeactivate

    allowHoveredActivate

    Controls whether to send activate and deactivate events to interactables that this interactor is hovered over but not selected when there is no current selection. By default, the interactor will only send activate and deactivate events to interactables that it's selected.

    Declaration
    public bool allowHoveredActivate { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    allowActivate
    GetActivateTargets(List<IXRActivateInteractable>)

    audioClipForOnHoverCanceled

    The AudioClip Unity plays on Hover Canceled.

    Declaration
    public AudioClip audioClipForOnHoverCanceled { get; set; }
    Property Value
    Type Description
    AudioClip
    See Also
    playAudioClipOnHoverCanceled

    audioClipForOnHoverEnter

    (Deprecated) The AudioClip Unity plays on Hover Entered.

    Declaration
    [Obsolete("audioClipForOnHoverEnter has been deprecated. Use audioClipForOnHoverEntered instead. (UnityUpgradable) -> audioClipForOnHoverEntered")]
    public AudioClip audioClipForOnHoverEnter { get; }
    Property Value
    Type Description
    AudioClip
    Remarks

    audioClipForOnHoverEnter has been deprecated. Use audioClipForOnHoverEntered instead.

    See Also
    playAudioClipOnHoverEntered

    AudioClipForOnHoverEnter

    (Deprecated) The AudioClip Unity plays on Hover Entered.

    Declaration
    [Obsolete("AudioClipForOnHoverEnter has been deprecated. Use audioClipForOnHoverEntered instead. (UnityUpgradable) -> audioClipForOnHoverEntered")]
    public AudioClip AudioClipForOnHoverEnter { get; set; }
    Property Value
    Type Description
    AudioClip
    Remarks

    AudioClipForOnHoverEnter has been deprecated. Use audioClipForOnHoverEntered instead.

    See Also
    playAudioClipOnHoverEntered

    audioClipForOnHoverEntered

    The AudioClip Unity plays on Hover Entered.

    Declaration
    public AudioClip audioClipForOnHoverEntered { get; set; }
    Property Value
    Type Description
    AudioClip
    See Also
    playAudioClipOnHoverEntered

    audioClipForOnHoverExit

    (Deprecated) The AudioClip Unity plays on Hover Exited.

    Declaration
    [Obsolete("audioClipForOnHoverExit has been deprecated. Use audioClipForOnHoverExited instead. (UnityUpgradable) -> audioClipForOnHoverExited")]
    public AudioClip audioClipForOnHoverExit { get; }
    Property Value
    Type Description
    AudioClip
    Remarks

    audioClipForOnHoverExit has been deprecated. Use audioClipForOnHoverExited instead.

    See Also
    playAudioClipOnHoverExited

    AudioClipForOnHoverExit

    (Deprecated) The AudioClip Unity plays on Hover Exited.

    Declaration
    [Obsolete("AudioClipForOnHoverExit has been deprecated. Use audioClipForOnHoverExited instead. (UnityUpgradable) -> audioClipForOnHoverExited")]
    public AudioClip AudioClipForOnHoverExit { get; set; }
    Property Value
    Type Description
    AudioClip
    Remarks

    AudioClipForOnHoverExit has been deprecated. Use audioClipForOnHoverExited instead.

    See Also
    playAudioClipOnHoverExited

    audioClipForOnHoverExited

    The AudioClip Unity plays on Hover Exited.

    Declaration
    public AudioClip audioClipForOnHoverExited { get; set; }
    Property Value
    Type Description
    AudioClip
    See Also
    playAudioClipOnHoverExited

    audioClipForOnSelectCanceled

    The AudioClip Unity plays on Select Canceled.

    Declaration
    public AudioClip audioClipForOnSelectCanceled { get; set; }
    Property Value
    Type Description
    AudioClip
    See Also
    playAudioClipOnSelectCanceled

    audioClipForOnSelectEnter

    (Deprecated) The AudioClip Unity plays on Select Entered.

    Declaration
    [Obsolete("audioClipForOnSelectEnter has been deprecated. Use audioClipForOnSelectEntered instead. (UnityUpgradable) -> audioClipForOnSelectEntered")]
    public AudioClip audioClipForOnSelectEnter { get; }
    Property Value
    Type Description
    AudioClip
    Remarks

    audioClipForOnSelectEnter has been deprecated. Use audioClipForOnSelectEntered instead.

    See Also
    playAudioClipOnSelectEntered

    AudioClipForOnSelectEnter

    (Deprecated) The AudioClip Unity plays on Select Entered.

    Declaration
    [Obsolete("AudioClipForOnSelectEnter has been deprecated. Use audioClipForOnSelectEntered instead. (UnityUpgradable) -> audioClipForOnSelectEntered")]
    public AudioClip AudioClipForOnSelectEnter { get; set; }
    Property Value
    Type Description
    AudioClip
    Remarks

    AudioClipForOnSelectEnter has been deprecated. Use audioClipForOnSelectEntered instead.

    See Also
    playAudioClipOnSelectEntered

    audioClipForOnSelectEntered

    The AudioClip Unity plays on Select Entered.

    Declaration
    public AudioClip audioClipForOnSelectEntered { get; set; }
    Property Value
    Type Description
    AudioClip
    See Also
    playAudioClipOnSelectEntered

    audioClipForOnSelectExit

    (Deprecated) The AudioClip Unity plays on Select Exited.

    Declaration
    [Obsolete("audioClipForOnSelectExit has been deprecated. Use audioClipForOnSelectExited instead. (UnityUpgradable) -> audioClipForOnSelectExited")]
    public AudioClip audioClipForOnSelectExit { get; }
    Property Value
    Type Description
    AudioClip
    Remarks

    audioClipForOnSelectExit has been deprecated. Use audioClipForOnSelectExited instead.

    See Also
    playAudioClipOnSelectExited

    AudioClipForOnSelectExit

    (Deprecated) The AudioClip Unity plays on Select Exited.

    Declaration
    [Obsolete("AudioClipForOnSelectExit has been deprecated. Use audioClipForOnSelectExited instead. (UnityUpgradable) -> audioClipForOnSelectExited")]
    public AudioClip AudioClipForOnSelectExit { get; set; }
    Property Value
    Type Description
    AudioClip
    Remarks

    AudioClipForOnSelectExit has been deprecated. Use audioClipForOnSelectExited instead.

    See Also
    playAudioClipOnSelectExited

    audioClipForOnSelectExited

    The AudioClip Unity plays on Select Exited.

    Declaration
    public AudioClip audioClipForOnSelectExited { get; set; }
    Property Value
    Type Description
    AudioClip
    See Also
    playAudioClipOnSelectExited

    hapticHoverCancelDuration

    The Haptics duration (in seconds) Unity plays on Hover Canceled.

    Declaration
    public float hapticHoverCancelDuration { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticHoverCancelIntensity
    playHapticsOnHoverCanceled

    hapticHoverCancelIntensity

    The Haptics intensity Unity plays on Hover Canceled.

    Declaration
    public float hapticHoverCancelIntensity { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticHoverCancelDuration
    playHapticsOnHoverCanceled

    hapticHoverEnterDuration

    The Haptics duration (in seconds) Unity plays on Hover Entered.

    Declaration
    public float hapticHoverEnterDuration { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticHoverEnterIntensity
    playHapticsOnHoverEntered

    hapticHoverEnterIntensity

    The Haptics intensity Unity plays on Hover Entered.

    Declaration
    public float hapticHoverEnterIntensity { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticHoverEnterDuration
    playHapticsOnHoverEntered

    hapticHoverExitDuration

    The Haptics duration (in seconds) Unity plays on Hover Exited.

    Declaration
    public float hapticHoverExitDuration { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticHoverExitIntensity
    playHapticsOnHoverExited

    hapticHoverExitIntensity

    The Haptics intensity Unity plays on Hover Exited.

    Declaration
    public float hapticHoverExitIntensity { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticHoverExitDuration
    playHapticsOnHoverExited

    hapticSelectCancelDuration

    The Haptics duration (in seconds) Unity plays on Select Canceled.

    Declaration
    public float hapticSelectCancelDuration { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticSelectCancelIntensity
    playHapticsOnSelectCanceled

    hapticSelectCancelIntensity

    The Haptics intensity Unity plays on Select Canceled.

    Declaration
    public float hapticSelectCancelIntensity { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticSelectCancelDuration
    playHapticsOnSelectCanceled

    hapticSelectEnterDuration

    The Haptics duration (in seconds) Unity plays on Select Entered.

    Declaration
    public float hapticSelectEnterDuration { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticSelectEnterIntensity
    playHapticsOnSelectEntered

    hapticSelectEnterIntensity

    The Haptics intensity Unity plays on Select Entered.

    Declaration
    public float hapticSelectEnterIntensity { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticSelectEnterDuration
    playHapticsOnSelectEntered

    hapticSelectExitDuration

    The Haptics duration (in seconds) Unity plays on Select Exited.

    Declaration
    public float hapticSelectExitDuration { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticSelectExitIntensity
    playHapticsOnSelectExited

    hapticSelectExitIntensity

    The Haptics intensity Unity plays on Select Exited.

    Declaration
    public float hapticSelectExitIntensity { get; set; }
    Property Value
    Type Description
    Single
    See Also
    hapticSelectExitDuration
    playHapticsOnSelectExited

    hideControllerOnSelect

    Controls whether this Interactor should hide the controller model on selection.

    Declaration
    public bool hideControllerOnSelect { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    hideControllerModel

    isSelectActive

    (Read Only) Indicates whether this Interactor is in a state where it could select.

    Declaration
    public override bool isSelectActive { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    XRBaseInteractor.isSelectActive

    isUISelectActive

    (Read Only) Whether or not Unity considers the UI Press controller input pressed.

    Declaration
    protected bool isUISelectActive { get; }
    Property Value
    Type Description
    Boolean

    Returns true if active. Otherwise, returns false.

    playAudioClipOnHoverCanceled

    Controls whether Unity plays an AudioClip on Hover Canceled.

    Declaration
    public bool playAudioClipOnHoverCanceled { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    audioClipForOnHoverCanceled

    playAudioClipOnHoverEnter

    (Deprecated) Controls whether Unity plays an AudioClip on Hover Entered.

    Declaration
    [Obsolete("playAudioClipOnHoverEnter has been deprecated. Use playAudioClipOnHoverEntered instead. (UnityUpgradable) -> playAudioClipOnHoverEntered")]
    public bool playAudioClipOnHoverEnter { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    playAudioClipOnHoverEnter has been deprecated. Use playAudioClipOnHoverEntered instead.

    See Also
    audioClipForOnHoverEntered

    playAudioClipOnHoverEntered

    Controls whether Unity plays an AudioClip on Hover Entered.

    Declaration
    public bool playAudioClipOnHoverEntered { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    audioClipForOnHoverEntered

    playAudioClipOnHoverExit

    (Deprecated) Controls whether Unity plays an AudioClip on Hover Exited.

    Declaration
    [Obsolete("playAudioClipOnHoverExit has been deprecated. Use playAudioClipOnHoverExited instead. (UnityUpgradable) -> playAudioClipOnHoverExited")]
    public bool playAudioClipOnHoverExit { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    playAudioClipOnHoverExit has been deprecated. Use playAudioClipOnHoverExited instead.

    See Also
    audioClipForOnHoverExited

    playAudioClipOnHoverExited

    Controls whether Unity plays an AudioClip on Hover Exited.

    Declaration
    public bool playAudioClipOnHoverExited { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    audioClipForOnHoverExited

    playAudioClipOnSelectCanceled

    Controls whether Unity plays an AudioClip on Select Canceled.

    Declaration
    public bool playAudioClipOnSelectCanceled { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    audioClipForOnSelectCanceled

    playAudioClipOnSelectEnter

    (Deprecated) Controls whether Unity plays an AudioClip on Select Entered.

    Declaration
    [Obsolete("playAudioClipOnSelectEnter has been deprecated. Use playAudioClipOnSelectEntered instead. (UnityUpgradable) -> playAudioClipOnSelectEntered")]
    public bool playAudioClipOnSelectEnter { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    playAudioClipOnSelectEnter has been deprecated. Use playAudioClipOnSelectEntered instead.

    See Also
    audioClipForOnSelectEntered

    playAudioClipOnSelectEntered

    Controls whether Unity plays an AudioClip on Select Entered.

    Declaration
    public bool playAudioClipOnSelectEntered { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    audioClipForOnSelectEntered

    playAudioClipOnSelectExit

    (Deprecated) Controls whether Unity plays an AudioClip on Select Exited.

    Declaration
    [Obsolete("playAudioClipOnSelectExit has been deprecated. Use playAudioClipOnSelectExited instead. (UnityUpgradable) -> playAudioClipOnSelectExited")]
    public bool playAudioClipOnSelectExit { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    playAudioClipOnSelectExit has been deprecated. Use playAudioClipOnSelectExited instead.

    See Also
    audioClipForOnSelectExited

    playAudioClipOnSelectExited

    Controls whether Unity plays an AudioClip on Select Exited.

    Declaration
    public bool playAudioClipOnSelectExited { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    audioClipForOnSelectExited

    playHapticsOnHoverCanceled

    Controls whether Unity plays haptics on Hover Canceled.

    Declaration
    public bool playHapticsOnHoverCanceled { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    hapticHoverCancelIntensity
    hapticHoverCancelDuration

    playHapticsOnHoverEnter

    (Deprecated) Controls whether Unity plays haptics on Hover Entered.

    Declaration
    [Obsolete("playHapticsOnHoverEnter has been deprecated. Use playHapticsOnHoverEntered instead. (UnityUpgradable) -> playHapticsOnHoverEntered")]
    public bool playHapticsOnHoverEnter { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    playHapticsOnHoverEnter has been deprecated. Use playHapticsOnHoverEntered instead.

    See Also
    hapticHoverEnterIntensity
    hapticHoverEnterDuration

    playHapticsOnHoverEntered

    Controls whether Unity plays haptics on Hover Entered.

    Declaration
    public bool playHapticsOnHoverEntered { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    hapticHoverEnterIntensity
    hapticHoverEnterDuration

    playHapticsOnHoverExited

    Controls whether Unity plays haptics on Hover Exited.

    Declaration
    public bool playHapticsOnHoverExited { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    hapticHoverExitIntensity
    hapticHoverExitDuration

    playHapticsOnSelectCanceled

    Controls whether Unity plays haptics on Select Canceled.

    Declaration
    public bool playHapticsOnSelectCanceled { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    hapticSelectCancelIntensity
    hapticSelectCancelDuration

    playHapticsOnSelectEnter

    (Deprecated) Controls whether Unity plays haptics on Select Entered.

    Declaration
    [Obsolete("playHapticsOnSelectEnter has been deprecated. Use playHapticsOnSelectEntered instead. (UnityUpgradable) -> playHapticsOnSelectEntered")]
    public bool playHapticsOnSelectEnter { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    playHapticsOnSelectEnter has been deprecated. Use playHapticsOnSelectEntered instead.

    See Also
    hapticSelectEnterIntensity
    hapticSelectEnterDuration

    playHapticsOnSelectEntered

    Controls whether Unity plays haptics on Select Entered.

    Declaration
    public bool playHapticsOnSelectEntered { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    hapticSelectEnterIntensity
    hapticSelectEnterDuration

    playHapticsOnSelectExit

    (Deprecated) Controls whether Unity plays haptics on Select Exited.

    Declaration
    [Obsolete("playHapticsOnSelectExit has been deprecated. Use playHapticsOnSelectExited instead. (UnityUpgradable) -> playHapticsOnSelectExited")]
    public bool playHapticsOnSelectExit { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    playHapticsOnSelectExit has been deprecated. Use playHapticsOnSelectExited instead.

    See Also
    hapticSelectExitIntensity
    hapticSelectExitDuration

    playHapticsOnSelectExited

    Controls whether Unity plays haptics on Select Exited.

    Declaration
    public bool playHapticsOnSelectExited { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    hapticSelectExitIntensity
    hapticSelectExitDuration

    selectActionTrigger

    Choose how Unity interprets the select input action from the controller. Controls between different input styles for determining if this Interactor can select, such as whether the button is currently pressed or just toggles the active state.

    Declaration
    public XRBaseControllerInteractor.InputTriggerType selectActionTrigger { get; set; }
    Property Value
    Type Description
    XRBaseControllerInteractor.InputTriggerType
    See Also
    XRBaseControllerInteractor.InputTriggerType
    isSelectActive

    shouldActivate

    (Read Only) Indicates whether this interactor is in a state where it should send the activate event this frame.

    Declaration
    public virtual bool shouldActivate { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IXRActivateInteractor.shouldActivate

    shouldDeactivate

    (Read Only) Indicates whether this interactor is in a state where it should send the deactivate event this frame.

    Declaration
    public virtual bool shouldDeactivate { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IXRActivateInteractor.shouldDeactivate

    validTargets

    (Deprecated) (Read Only) A list of Interactables that this Interactor could possibly interact with this frame.

    Declaration
    [Obsolete("validTargets has been deprecated. Use a property of type List<IXRInteractable> instead.")]
    protected virtual List<XRBaseInteractable> validTargets { get; }
    Property Value
    Type Description
    List<XRBaseInteractable>

    xrController

    The controller instance that is queried for input.

    Declaration
    public XRBaseController xrController { get; set; }
    Property Value
    Type Description
    XRBaseController

    Methods

    Awake()

    See MonoBehaviour.

    Declaration
    protected override void Awake()
    Overrides
    XRBaseInteractor.Awake()

    GetActivateTargets(List<IXRActivateInteractable>)

    Retrieve the list of Interactables that this Interactor could possibly activate or deactivate this frame.

    Declaration
    public virtual void GetActivateTargets(List<IXRActivateInteractable> targets)
    Parameters
    Type Name Description
    List<IXRActivateInteractable> targets

    The results list to populate with Interactables that are valid for activate or deactivate.

    Implements
    IXRActivateInteractor.GetActivateTargets(List<IXRActivateInteractable>)
    Remarks

    When implementing this method, Unity expects you to clear targets before adding to it.

    OnHoverEntering(HoverEnterEventArgs)

    The XRInteractionManager calls this method right before the Interactor first initiates hovering over an Interactable in a first pass.

    Declaration
    protected override void OnHoverEntering(HoverEnterEventArgs args)
    Parameters
    Type Name Description
    HoverEnterEventArgs args

    Event data containing the Interactable that is being hovered over.

    Overrides
    XRBaseInteractor.OnHoverEntering(HoverEnterEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnHoverEntered(HoverEnterEventArgs)

    OnHoverExiting(HoverExitEventArgs)

    The XRInteractionManager calls this method right before the Interactor ends hovering over an Interactable in a first pass.

    Declaration
    protected override void OnHoverExiting(HoverExitEventArgs args)
    Parameters
    Type Name Description
    HoverExitEventArgs args

    Event data containing the Interactable that is no longer hovered over.

    Overrides
    XRBaseInteractor.OnHoverExiting(HoverExitEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnHoverExited(HoverExitEventArgs)

    OnSelectEntering(SelectEnterEventArgs)

    The XRInteractionManager calls this method right before the Interactor first initiates selection of an Interactable in a first pass.

    Declaration
    protected override void OnSelectEntering(SelectEnterEventArgs args)
    Parameters
    Type Name Description
    SelectEnterEventArgs args

    Event data containing the Interactable that is being selected.

    Overrides
    XRBaseInteractor.OnSelectEntering(SelectEnterEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnSelectEntered(SelectEnterEventArgs)

    OnSelectExiting(SelectExitEventArgs)

    The XRInteractionManager calls this method right before the Interactor ends selection of an Interactable in a first pass.

    Declaration
    protected override void OnSelectExiting(SelectExitEventArgs args)
    Parameters
    Type Name Description
    SelectExitEventArgs args

    Event data containing the Interactable that is no longer selected.

    Overrides
    XRBaseInteractor.OnSelectExiting(SelectExitEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnSelectExited(SelectExitEventArgs)

    PlayAudio(AudioClip)

    Play an AudioClip.

    Declaration
    protected virtual void PlayAudio(AudioClip audioClip)
    Parameters
    Type Name Description
    AudioClip audioClip

    The clip to play.

    PreprocessInteractor(XRInteractionUpdateOrder.UpdatePhase)

    The XRInteractionManager calls this method to update the Interactor before interaction events occur. Interactors should use this method to do tasks like determine their valid targets.

    Declaration
    public override void PreprocessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
    Parameters
    Type Name Description
    XRInteractionUpdateOrder.UpdatePhase updatePhase

    The update phase this is called during.

    Overrides
    XRBaseInteractor.PreprocessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    Implements
    IXRInteractor.PreprocessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    Remarks

    Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.

    See Also
    XRInteractionUpdateOrder.UpdatePhase

    ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)

    The XRInteractionManager calls this method to update the Interactor after interaction events occur.

    Declaration
    public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
    Parameters
    Type Name Description
    XRInteractionUpdateOrder.UpdatePhase updatePhase

    The update phase this is called during.

    Overrides
    XRBaseInteractor.ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    Implements
    IXRInteractor.ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    Remarks

    Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.

    See Also
    XRInteractionUpdateOrder.UpdatePhase
    ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase)

    SendHapticImpulse(Single, Single)

    Play a haptic impulse on the controller if one is available.

    Declaration
    public bool SendHapticImpulse(float amplitude, float duration)
    Parameters
    Type Name Description
    Single amplitude

    Amplitude (from 0.0 to 1.0) to play impulse at.

    Single duration

    Duration (in seconds) to play haptic impulse.

    Returns
    Type Description
    Boolean

    Returns true if successful. Otherwise, returns false.

    See Also
    SendHapticImpulse(Single, Single)

    Extension Methods

    XRHoverInteractorExtensions.GetOldestInteractableHovered(IXRHoverInteractor)
    XRSelectInteractorExtensions.GetOldestInteractableSelected(IXRSelectInteractor)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023