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.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public abstract class XRBaseControllerInteractor : XRBaseInteractor
Properties
audioClipForOnHoverCanceled
The
Declaration
public AudioClip audioClipForOnHoverCanceled { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnHoverEnter
The
Declaration
public AudioClip audioClipForOnHoverEnter { get; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
AudioClipForOnHoverEnter
The
Declaration
public AudioClip AudioClipForOnHoverEnter { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnHoverEntered
The
Declaration
public AudioClip audioClipForOnHoverEntered { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnHoverExit
The
Declaration
public AudioClip audioClipForOnHoverExit { get; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
AudioClipForOnHoverExit
The
Declaration
public AudioClip AudioClipForOnHoverExit { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnHoverExited
The
Declaration
public AudioClip audioClipForOnHoverExited { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnSelectCanceled
The
Declaration
public AudioClip audioClipForOnSelectCanceled { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnSelectEnter
The
Declaration
public AudioClip audioClipForOnSelectEnter { get; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
AudioClipForOnSelectEnter
The
Declaration
public AudioClip AudioClipForOnSelectEnter { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnSelectEntered
The
Declaration
public AudioClip audioClipForOnSelectEntered { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnSelectExit
The
Declaration
public AudioClip audioClipForOnSelectExit { get; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
AudioClipForOnSelectExit
The
Declaration
public AudioClip AudioClipForOnSelectExit { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
audioClipForOnSelectExited
The
Declaration
public AudioClip audioClipForOnSelectExited { get; set; }
Property Value
Type | Description |
---|---|
AudioClip |
See Also
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
The Haptics intensity to play on Hover Canceled.
Declaration
public float hapticHoverCancelIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
See Also
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
The Haptics intensity to play on Hover Entered.
Declaration
public float hapticHoverEnterIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
See Also
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
The Haptics intensity to play on Hover Exited.
Declaration
public float hapticHoverExitIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
See Also
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
The Haptics intensity to play on Select Canceled.
Declaration
public float hapticSelectCancelIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
See Also
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
The Haptics intensity to play on Select Entered.
Declaration
public float hapticSelectEnterIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
See Also
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
The Haptics intensity to play on Select Exited.
Declaration
public float hapticSelectExitIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
See Also
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
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
isUISelectActive
Whether or not the UI Press controller input is considered pressed.
Declaration
protected bool isUISelectActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
playAudioClipOnHoverCanceled
Controls whether to play an
Declaration
public bool playAudioClipOnHoverCanceled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnHoverEnter
Controls whether to play an
Declaration
public bool playAudioClipOnHoverEnter { get; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnHoverEntered
Controls whether to play an
Declaration
public bool playAudioClipOnHoverEntered { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnHoverExit
Controls whether to play an
Declaration
public bool playAudioClipOnHoverExit { get; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnHoverExited
Controls whether to play an
Declaration
public bool playAudioClipOnHoverExited { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnSelectCanceled
Controls whether to play an
Declaration
public bool playAudioClipOnSelectCanceled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnSelectEnter
Controls whether to play an
Declaration
public bool playAudioClipOnSelectEnter { get; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnSelectEntered
Controls whether to play an
Declaration
public bool playAudioClipOnSelectEntered { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnSelectExit
Controls whether to play an
Declaration
public bool playAudioClipOnSelectExit { get; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playAudioClipOnSelectExited
Controls whether to play an
Declaration
public bool playAudioClipOnSelectExited { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnHoverCanceled
Controls whether to play haptics on Hover Canceled.
Declaration
public bool playHapticsOnHoverCanceled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnHoverEnter
Controls whether to play haptics on Hover Entered.
Declaration
public bool playHapticsOnHoverEnter { get; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnHoverEntered
Controls whether to play haptics on Hover Entered.
Declaration
public bool playHapticsOnHoverEntered { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnHoverExited
Controls whether to play haptics on Hover Exited.
Declaration
public bool playHapticsOnHoverExited { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnSelectCanceled
Controls whether to play haptics on Select Canceled.
Declaration
public bool playHapticsOnSelectCanceled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnSelectEnter
Controls whether to play haptics on Select Entered.
Declaration
public bool playHapticsOnSelectEnter { get; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnSelectEntered
Controls whether to play haptics on Select Entered.
Declaration
public bool playHapticsOnSelectEntered { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnSelectExit
Controls whether to play haptics on Select Exited.
Declaration
public bool playHapticsOnSelectExit { get; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
playHapticsOnSelectExited
Controls whether to play haptics on Select Exited.
Declaration
public bool playHapticsOnSelectExited { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
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
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
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
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
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
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
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
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
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
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
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
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 |