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
    XRBaseInteractor
    XRBaseControllerInteractor
    XRDirectInteractor
    XRRayInteractor
    Inherited Members
    XRBaseInteractor.registered
    XRBaseInteractor.unregistered
    XRBaseInteractor.interactionManager
    XRBaseInteractor.interactionLayerMask
    XRBaseInteractor.attachTransform
    XRBaseInteractor.startingSelectedInteractable
    XRBaseInteractor.hoverEntered
    XRBaseInteractor.hoverExited
    XRBaseInteractor.selectEntered
    XRBaseInteractor.selectExited
    XRBaseInteractor.allowHover
    XRBaseInteractor.allowSelect
    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.OnRegistered(InteractorRegisteredEventArgs)
    XRBaseInteractor.OnUnregistered(InteractorUnregisteredEventArgs)
    XRBaseInteractor.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractor.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractor.OnSelectEntered(SelectEnterEventArgs)
    XRBaseInteractor.OnSelectExited(SelectExitEventArgs)
    XRBaseInteractor.StartManualInteraction(XRBaseInteractable)
    XRBaseInteractor.EndManualInteraction()
    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)
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public abstract class XRBaseControllerInteractor : XRBaseInteractor

    Properties

    audioClipForOnHoverCanceled

    The to play on Hover Canceled.

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

    audioClipForOnHoverEnter

    The to play on Hover Entered.

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

    AudioClipForOnHoverEnter

    The to play on Hover Entered.

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

    audioClipForOnHoverEntered

    The to play on Hover Entered.

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

    audioClipForOnHoverExit

    The to play on Hover Exited.

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

    AudioClipForOnHoverExit

    The to play on Hover Exited.

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

    audioClipForOnHoverExited

    The to play on Hover Exited.

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

    audioClipForOnSelectCanceled

    The to play on Select Canceled.

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

    audioClipForOnSelectEnter

    The to play on Select Entered.

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

    AudioClipForOnSelectEnter

    The to play on Select Entered.

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

    audioClipForOnSelectEntered

    The to play on Select Entered.

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

    audioClipForOnSelectExit

    The to play on Select Exited.

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

    AudioClipForOnSelectExit

    The to play on Select Exited.

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

    audioClipForOnSelectExited

    The to play on Select Exited.

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

    hapticHoverCancelDuration

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

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

    hapticHoverCancelIntensity

    The Haptics intensity to play on Hover Canceled.

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

    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

    hapticSelectCancelDuration

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

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

    hapticSelectCancelIntensity

    The Haptics intensity to play on Select Canceled.

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

    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 model on selection.

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

    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

    Whether or not the UI Press controller input is considered pressed.

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

    Returns true if active. Otherwise, returns false.

    playAudioClipOnHoverCanceled

    Controls whether to play an on Hover Canceled.

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

    playAudioClipOnHoverEnter

    Controls whether to play an on Hover Entered.

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

    playAudioClipOnHoverEntered

    Controls whether to play an on Hover Entered.

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

    playAudioClipOnHoverExit

    Controls whether to play an on Hover Exited.

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

    playAudioClipOnHoverExited

    Controls whether to play an on Hover Exited.

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

    playAudioClipOnSelectCanceled

    Controls whether to play an on Select Canceled.

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

    playAudioClipOnSelectEnter

    Controls whether to play an on Select Entered.

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

    playAudioClipOnSelectEntered

    Controls whether to play an on Select Entered.

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

    playAudioClipOnSelectExit

    Controls whether to play an on Select Exited.

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

    playAudioClipOnSelectExited

    Controls whether to play an on Select Exited.

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

    playHapticsOnHoverCanceled

    Controls whether to play haptics on Hover Canceled.

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

    playHapticsOnHoverEnter

    Controls whether to play haptics on Hover Entered.

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

    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

    playHapticsOnSelectCanceled

    Controls whether to play haptics on Select Canceled.

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

    playHapticsOnSelectEnter

    Controls whether to play haptics on Select Entered.

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

    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

    Controls whether to play haptics on Select Exited.

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

    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 Interactables that this Interactor could possibly interact with this frame.

    Declaration
    protected abstract List<XRBaseInteractable> validTargets { get; }
    Property Value
    Type Description
    List<XRBaseInteractable>
    See Also
    GetValidTargets(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 .

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

    OnHoverEntering(HoverEnterEventArgs)

    This method is called by the Interaction Manager 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)

    This method is called by the Interaction Manager 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)

    This method is called by the Interaction Manager 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)

    This method is called by the Interaction Manager 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 .

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

    The clip to play.

    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

    The update phase this is called during.

    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. Otherwise, returns false.

    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