Class XRBaseControllerInteractor | XR Interaction Toolkit | 0.0.6-preview
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.interactionManager
    XRBaseInteractor.InteractionLayerMask
    XRBaseInteractor.attachTransform
    XRBaseInteractor.selectTarget
    XRBaseInteractor.m_HoverTargets
    XRBaseInteractor.startingSelectedInteractable
    XRBaseInteractor.interactionLayerMask
    XRBaseInteractor.onHoverEnter
    XRBaseInteractor.onHoverExit
    XRBaseInteractor.onSelectEnter
    XRBaseInteractor.onSelectExit
    XRBaseInteractor.allowHover
    XRBaseInteractor.allowSelect
    XRBaseInteractor.enableInteractions
    XRBaseInteractor.Reset()
    XRBaseInteractor.OnEnable()
    XRBaseInteractor.OnDisable()
    XRBaseInteractor.GetHoverTargets(List<XRBaseInteractable>)
    XRBaseInteractor.GetValidTargets(List<XRBaseInteractable>)
    XRBaseInteractor.isHoverActive
    XRBaseInteractor.CanHover(XRBaseInteractable)
    XRBaseInteractor.CanSelect(XRBaseInteractable)
    XRBaseInteractor.isSelectExclusive
    XRBaseInteractor.overrideSelectedInteractableMovement
    XRBaseInteractor.selectedInteractableMovementTypeOverride
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public abstract class XRBaseControllerInteractor : XRBaseInteractor

    Properties

    AudioClipForOnHoverEnter

    Gets or sets the AudioClip to play on Hover Enter.

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

    AudioClipForOnHoverExit

    Gets or sets the AudioClip to play on Hover Exit.

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

    AudioClipForOnSelectEnter

    Gets or sets the AudioClip to play on Select Enter.

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

    AudioClipForOnSelectExit

    Gets or sets the AudioClip to play on Select Exit.

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

    hapticHoverEnterDuration

    Gets or sets the Haptics duration to play on HoverEnter.

    Declaration
    public float hapticHoverEnterDuration { get; set; }
    Property Value
    Type Description
    Single

    hapticHoverEnterIntensity

    Gets or sets the Haptics intensity to play on HoverEnter.

    Declaration
    public float hapticHoverEnterIntensity { get; set; }
    Property Value
    Type Description
    Single

    hapticHoverExitDuration

    Gets or sets the Haptics duration to play on HoverExit.

    Declaration
    public float hapticHoverExitDuration { get; set; }
    Property Value
    Type Description
    Single

    hapticHoverExitIntensity

    Gets or sets the Haptics intensity to play on HoverExit.

    Declaration
    public float hapticHoverExitIntensity { get; set; }
    Property Value
    Type Description
    Single

    hapticSelectEnterDuration

    Gets or sets the Haptics duration to play on SelectEnter.

    Declaration
    public float hapticSelectEnterDuration { get; set; }
    Property Value
    Type Description
    Single

    hapticSelectEnterIntensity

    Gets or sets the Haptics intensity to play on SelectEnter.

    Declaration
    public float hapticSelectEnterIntensity { get; set; }
    Property Value
    Type Description
    Single

    hapticSelectExitDuration

    Gets or sets the Haptics duration to play on SelectExit.

    Declaration
    public float hapticSelectExitDuration { get; set; }
    Property Value
    Type Description
    Single

    hapticSelectExitIntensity

    Gets or sets the Haptics intensity to play on SelectExit.

    Declaration
    public float hapticSelectExitIntensity { get; set; }
    Property Value
    Type Description
    Single

    hideControllerOnSelect

    Gets or sets 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

    playAudioClipOnHoverEnter

    Gets or sets whether to play AudioClip on Hover Enter.

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

    playAudioClipOnHoverExit

    Gets or sets whether to play AudioClip on Hover Exit.

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

    playAudioClipOnSelectEnter

    Gets or sets whether to play AudioClip on Select Enter.

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

    playAudioClipOnSelectExit

    Gets or sets whether to play AudioClip on Select Exit.

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

    playHapticsOnHoverEnter

    Gets or sets whether to play haptics on HoverEnter.

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

    playHapticsOnHoverExit

    Gets or sets whether to play haptics on HoverExit.

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

    playHapticsOnSelectEnter

    Gets or sets whether to play haptics on SelectEnter.

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

    playHapticsOnSelectExit

    Gets or sets whether to play haptics on SelectExit.

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

    toggleSelect

    Gets or sets whether this interactor toggles selection on button press (rather than selection on press).

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

    Methods

    Awake()

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

    OnHoverEnter(XRBaseInteractable)

    This method is called when the interactor first initiates hover of an interactable.

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

    Interactable that is being hovered.

    Overrides
    XRBaseInteractor.OnHoverEnter(XRBaseInteractable)

    OnHoverExit(XRBaseInteractable)

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

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

    Interactable that is no longer hovered over.

    Overrides
    XRBaseInteractor.OnHoverExit(XRBaseInteractable)

    OnSelectEnter(XRBaseInteractable)

    This method is called when the interactor first initiates selection of an interactable.

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

    Interactable that is being selected.

    Overrides
    XRBaseInteractor.OnSelectEnter(XRBaseInteractable)

    OnSelectExit(XRBaseInteractable)

    This method is called when the interactor ends selection of an interactable.

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

    Interactable that is no longer selected.

    Overrides
    XRBaseInteractor.OnSelectExit(XRBaseInteractable)

    ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)

    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
    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