Class XRBaseControllerInteractor | XR Interaction Toolkit | 0.10.0-preview.7
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.interactionManager
    XRBaseInteractor.interactionLayerMask
    XRBaseInteractor.attachTransform
    XRBaseInteractor.startingSelectedInteractable
    XRBaseInteractor.onHoverEntered
    XRBaseInteractor.onHoverEnter
    XRBaseInteractor.onHoverExited
    XRBaseInteractor.onHoverExit
    XRBaseInteractor.onSelectEntered
    XRBaseInteractor.onSelectEnter
    XRBaseInteractor.onSelectExited
    XRBaseInteractor.onSelectExit
    XRBaseInteractor.allowHover
    XRBaseInteractor.allowSelect
    XRBaseInteractor.enableInteractions
    XRBaseInteractor.isPerformingManualInteraction
    XRBaseInteractor.selectTarget
    XRBaseInteractor.hoverTargets
    XRBaseInteractor.Reset()
    XRBaseInteractor.OnEnable()
    XRBaseInteractor.OnDisable()
    XRBaseInteractor.Start()
    XRBaseInteractor.OnDestroy()
    XRBaseInteractor.GetHoverTargets(List<XRBaseInteractable>)
    XRBaseInteractor.GetValidTargets(List<XRBaseInteractable>)
    XRBaseInteractor.isHoverActive
    XRBaseInteractor.CanHover(XRBaseInteractable)
    XRBaseInteractor.CanSelect(XRBaseInteractable)
    XRBaseInteractor.requireSelectExclusive
    XRBaseInteractor.selectedInteractableMovementTypeOverride
    XRBaseInteractor.OnHoverEntered(XRBaseInteractable)
    XRBaseInteractor.OnHoverExited(XRBaseInteractable)
    XRBaseInteractor.OnSelectEntered(XRBaseInteractable)
    XRBaseInteractor.OnSelectExited(XRBaseInteractable)
    XRBaseInteractor.StartManualInteraction(XRBaseInteractable)
    XRBaseInteractor.EndManualInteraction()
    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
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public abstract class XRBaseControllerInteractor : XRBaseInteractor

    Properties

    audioClipForOnHoverEnter

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

    AudioClipForOnHoverEnter

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

    audioClipForOnHoverEntered

    The AudioClip to play on Hover Entered.

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

    audioClipForOnHoverExit

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

    AudioClipForOnHoverExit

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

    audioClipForOnHoverExited

    The AudioClip to play on Hover Exited.

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

    audioClipForOnSelectEnter

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

    AudioClipForOnSelectEnter

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

    audioClipForOnSelectEntered

    The AudioClip to play on Select Entered.

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

    audioClipForOnSelectExit

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

    AudioClipForOnSelectExit

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

    audioClipForOnSelectExited

    The AudioClip to play on Select Exited.

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

    hapticHoverEnterDuration

    The Haptics duration (in seconds) to play on Hover Entered.

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

    hapticHoverEnterIntensity

    The Haptics intensity to play on Hover Entered.

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

    hapticHoverExitDuration

    The Haptics duration (in seconds) to play on Hover Exited.

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

    hapticHoverExitIntensity

    The Haptics intensity to play on Hover Exited.

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

    hapticSelectEnterDuration

    The Haptics duration (in seconds) to play on Select Entered.

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

    hapticSelectEnterIntensity

    The Haptics intensity to play on Select Entered.

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

    hapticSelectExitDuration

    The Haptics duration (in seconds) to play on Select Exited.

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

    hapticSelectExitIntensity

    The Haptics intensity to play 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 on selection.

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

    isSelectActive

    Gets whether the selection state is active for this interactor. This will check if the controller has a valid selection state or whether toggle selection is currently on and active.

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

    isUISelectActive

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

    playAudioClipOnHoverEnter

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

    playAudioClipOnHoverEntered

    Controls whether to play an AudioClip on Hover Entered.

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

    playAudioClipOnHoverExit

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

    playAudioClipOnHoverExited

    Controls whether to play an AudioClip on Hover Exited.

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

    playAudioClipOnSelectEnter

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

    playAudioClipOnSelectEntered

    Controls whether to play an AudioClip on Select Entered.

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

    playAudioClipOnSelectExit

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

    playAudioClipOnSelectExited

    Controls whether to play an AudioClip on Select Exited.

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

    playHapticsOnHoverEnter

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

    playHapticsOnHoverEntered

    Controls whether to play haptics on Hover Entered.

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

    playHapticsOnHoverExited

    Controls whether to play haptics on Hover Exited.

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

    playHapticsOnSelectEnter

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

    playHapticsOnSelectEntered

    Controls whether to play haptics on Select Entered.

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

    playHapticsOnSelectExit

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

    playHapticsOnSelectExited

    Controls whether to play haptics on Select Exited.

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

    selectActionTrigger

    Controls whether this interactor toggles selection on button press (rather than selection on press).

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

    validTargets

    (Read Only) A list of targets that can be selected.

    Declaration
    protected abstract List<XRBaseInteractable> validTargets { get; }
    Property Value
    Type Description
    List<XRBaseInteractable>

    xrController

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

    Methods

    Awake()

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

    OnHoverEntering(XRBaseInteractable)

    This method is called by the interaction manager right before the interactor first initiates hovering over an interactable.

    Declaration
    protected override void OnHoverEntering(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable

    Interactable that is being hovered over.

    Overrides
    XRBaseInteractor.OnHoverEntering(XRBaseInteractable)
    See Also
    OnHoverEntered(XRBaseInteractable)

    OnHoverExiting(XRBaseInteractable)

    This method is called by the interaction manager right before the interactor ends hovering over an interactable.

    Declaration
    protected override void OnHoverExiting(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable

    Interactable that is no longer hovered over.

    Overrides
    XRBaseInteractor.OnHoverExiting(XRBaseInteractable)
    See Also
    OnHoverExited(XRBaseInteractable)

    OnSelectEntering(XRBaseInteractable)

    This method is called by the interaction manager right before the first initiates selection of an interactable.

    Declaration
    protected override void OnSelectEntering(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable

    Interactable that is being selected.

    Overrides
    XRBaseInteractor.OnSelectEntering(XRBaseInteractable)
    See Also
    OnSelectEntered(XRBaseInteractable)

    OnSelectExiting(XRBaseInteractable)

    This method is called by the interaction manager right before the interactor ends selection of an interactable.

    Declaration
    protected override void OnSelectExiting(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable

    Interactable that is no longer selected.

    Overrides
    XRBaseInteractor.OnSelectExiting(XRBaseInteractable)
    See Also
    OnSelectExited(XRBaseInteractable)

    ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)

    This method is called by the interaction manager to update the interactor. Please see the interaction manager documentation for more details on update order.

    Declaration
    public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
    Parameters
    Type Name Description
    XRInteractionUpdateOrder.UpdatePhase updatePhase
    Overrides
    XRBaseInteractor.ProcessInteractor(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. Returns false otherwise.

    See Also
    SendHapticImpulse(Single, Single)
    Back to top
    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