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
XRBaseControllerInteractor
public abstract class XRBaseControllerInteractor : XRBaseInteractor
Properties
Declaration
[Obsolete("audioClipForOnHoverEnter has been deprecated. Use audioClipForOnHoverEntered instead. (UnityUpgradable) -> audioClipForOnHoverEntered")]
public AudioClip audioClipForOnHoverEnter { get; }
Property Value
Declaration
[Obsolete("AudioClipForOnHoverEnter has been deprecated. Use audioClipForOnHoverEntered instead. (UnityUpgradable) -> audioClipForOnHoverEntered")]
public AudioClip AudioClipForOnHoverEnter { get; set; }
Property Value
Declaration
public AudioClip audioClipForOnHoverEntered { get; set; }
Property Value
Declaration
[Obsolete("audioClipForOnHoverExit has been deprecated. Use audioClipForOnHoverExited instead. (UnityUpgradable) -> audioClipForOnHoverExited")]
public AudioClip audioClipForOnHoverExit { get; }
Property Value
Declaration
[Obsolete("AudioClipForOnHoverExit has been deprecated. Use audioClipForOnHoverExited instead. (UnityUpgradable) -> audioClipForOnHoverExited")]
public AudioClip AudioClipForOnHoverExit { get; set; }
Property Value
Declaration
public AudioClip audioClipForOnHoverExited { get; set; }
Property Value
Declaration
[Obsolete("audioClipForOnSelectEnter has been deprecated. Use audioClipForOnSelectEntered instead. (UnityUpgradable) -> audioClipForOnSelectEntered")]
public AudioClip audioClipForOnSelectEnter { get; }
Property Value
Declaration
[Obsolete("AudioClipForOnSelectEnter has been deprecated. Use audioClipForOnSelectEntered instead. (UnityUpgradable) -> audioClipForOnSelectEntered")]
public AudioClip AudioClipForOnSelectEnter { get; set; }
Property Value
Declaration
public AudioClip audioClipForOnSelectEntered { get; set; }
Property Value
Declaration
[Obsolete("audioClipForOnSelectExit has been deprecated. Use audioClipForOnSelectExited instead. (UnityUpgradable) -> audioClipForOnSelectExited")]
public AudioClip audioClipForOnSelectExit { get; }
Property Value
Declaration
[Obsolete("AudioClipForOnSelectExit has been deprecated. Use audioClipForOnSelectExited instead. (UnityUpgradable) -> audioClipForOnSelectExited")]
public AudioClip AudioClipForOnSelectExit { get; set; }
Property Value
Declaration
public AudioClip audioClipForOnSelectExited { get; set; }
Property Value
The Haptics duration (in seconds) to play on Hover Entered.
Declaration
public float hapticHoverEnterDuration { get; set; }
Property Value
The Haptics intensity to play on Hover Entered.
Declaration
public float hapticHoverEnterIntensity { get; set; }
Property Value
The Haptics duration (in seconds) to play on Hover Exited.
Declaration
public float hapticHoverExitDuration { get; set; }
Property Value
The Haptics intensity to play on Hover Exited.
Declaration
public float hapticHoverExitIntensity { get; set; }
Property Value
The Haptics duration (in seconds) to play on Select Entered.
Declaration
public float hapticSelectEnterDuration { get; set; }
Property Value
The Haptics intensity to play on Select Entered.
Declaration
public float hapticSelectEnterIntensity { get; set; }
Property Value
The Haptics duration (in seconds) to play on Select Exited.
Declaration
public float hapticSelectExitDuration { get; set; }
Property Value
The Haptics intensity to play on Select Exited.
Declaration
public float hapticSelectExitIntensity { get; set; }
Property Value
Controls whether this interactor should hide the controller on selection.
Declaration
public bool hideControllerOnSelect { get; set; }
Property Value
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
Overrides
Declaration
protected bool isUISelectActive { get; }
Property Value
Declaration
[Obsolete("playAudioClipOnHoverEnter has been deprecated. Use playAudioClipOnHoverEntered instead. (UnityUpgradable) -> playAudioClipOnHoverEntered")]
public bool playAudioClipOnHoverEnter { get; }
Property Value
Controls whether to play an AudioClip on Hover Entered.
Declaration
public bool playAudioClipOnHoverEntered { get; set; }
Property Value
Declaration
[Obsolete("playAudioClipOnHoverExit has been deprecated. Use playAudioClipOnHoverExited instead. (UnityUpgradable) -> playAudioClipOnHoverExited")]
public bool playAudioClipOnHoverExit { get; }
Property Value
Controls whether to play an AudioClip on Hover Exited.
Declaration
public bool playAudioClipOnHoverExited { get; set; }
Property Value
Declaration
[Obsolete("playAudioClipOnSelectEnter has been deprecated. Use playAudioClipOnSelectEntered instead. (UnityUpgradable) -> playAudioClipOnSelectEntered")]
public bool playAudioClipOnSelectEnter { get; }
Property Value
Controls whether to play an AudioClip on Select Entered.
Declaration
public bool playAudioClipOnSelectEntered { get; set; }
Property Value
Declaration
[Obsolete("playAudioClipOnSelectExit has been deprecated. Use playAudioClipOnSelectExited instead. (UnityUpgradable) -> playAudioClipOnSelectExited")]
public bool playAudioClipOnSelectExit { get; }
Property Value
Controls whether to play an AudioClip on Select Exited.
Declaration
public bool playAudioClipOnSelectExited { get; set; }
Property Value
Declaration
[Obsolete("playHapticsOnHoverEnter has been deprecated. Use playHapticsOnHoverEntered instead. (UnityUpgradable) -> playHapticsOnHoverEntered")]
public bool playHapticsOnHoverEnter { get; }
Property Value
Controls whether to play haptics on Hover Entered.
Declaration
public bool playHapticsOnHoverEntered { get; set; }
Property Value
Controls whether to play haptics on Hover Exited.
Declaration
public bool playHapticsOnHoverExited { get; set; }
Property Value
Declaration
[Obsolete("playHapticsOnSelectEnter has been deprecated. Use playHapticsOnSelectEntered instead. (UnityUpgradable) -> playHapticsOnSelectEntered")]
public bool playHapticsOnSelectEnter { get; }
Property Value
Controls whether to play haptics on Select Entered.
Declaration
public bool playHapticsOnSelectEntered { get; set; }
Property Value
Declaration
[Obsolete("playHapticsOnSelectExit has been deprecated. Use playHapticsOnSelectExited instead. (UnityUpgradable) -> playHapticsOnSelectExited")]
public bool playHapticsOnSelectExit { get; }
Property Value
Controls whether to play haptics on Select Exited.
Declaration
public bool playHapticsOnSelectExited { get; set; }
Property Value
Controls whether this interactor toggles selection on button press (rather than selection on press).
Declaration
public XRBaseControllerInteractor.InputTriggerType selectActionTrigger { get; set; }
Property Value
(Read Only) A list of targets that can be selected.
Declaration
protected abstract List<XRBaseInteractable> validTargets { get; }
Property Value
Declaration
public XRBaseController xrController { get; set; }
Property Value
Methods
Declaration
protected override void Awake()
Overrides
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
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
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
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
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
Overrides
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
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.