Class ARBaseGestureInteractable
Base class that manipulates an object via a gesture.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public abstract class ARBaseGestureInteractable : XRBaseInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRFocusInteractable, IXRInteractionStrengthInteractable, IXRInteractable, IXROverridesGazeAutoSelect
Properties
excludeUITouches
When true, will exclude touches that are over UI. Used to make screen space canvas elements block touches from hitting planes behind it.
Declaration
public bool excludeUITouches { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
See Also
gestureInteractor
The ARGestureInteractor that this Interactable listens to for gestures when connected.
Declaration
protected ARGestureInteractor gestureInteractor { get; }
Property Value
| Type | Description |
|---|---|
| ARGestureInteractor |
See Also
xrOrigin
The Unity.XR.CoreUtils.XROrigin that this Interactable will use (such as to get the Camera or to transform from Session space). Will find one if null.
Declaration
public XROrigin xrOrigin { get; set; }
Property Value
| Type | Description |
|---|---|
| XROrigin |
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
CanStartManipulationForGesture(DragGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected virtual bool CanStartManipulationForGesture(DragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| DragGesture | gesture | The current gesture. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the manipulation can start. Otherwise, returns false. |
CanStartManipulationForGesture(PinchGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected virtual bool CanStartManipulationForGesture(PinchGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| PinchGesture | gesture | The current gesture. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the manipulation can start. Otherwise, returns false. |
CanStartManipulationForGesture(TapGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected virtual bool CanStartManipulationForGesture(TapGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TapGesture | gesture | The current gesture. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the manipulation can start. Otherwise, returns false. |
CanStartManipulationForGesture(TwistGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected virtual bool CanStartManipulationForGesture(TwistGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwistGesture | gesture | The current gesture. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the manipulation can start. Otherwise, returns false. |
CanStartManipulationForGesture(TwoFingerDragGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected virtual bool CanStartManipulationForGesture(TwoFingerDragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwoFingerDragGesture | gesture | The current gesture. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the manipulation can start. Otherwise, returns false. |
ConnectGestureInteractor()
Connect an ARGestureInteractor's gestures to this interactable.
Declaration
protected virtual void ConnectGestureInteractor()
DisconnectGestureInteractor()
Disconnect an ARGestureInteractor's gestures from this interactable.
Declaration
protected virtual void DisconnectGestureInteractor()
IsGameObjectSelected()
Determines if the ARGestureInteractor is selecting the GameObject this Interactable is attached to.
Declaration
protected virtual bool IsGameObjectSelected()
Returns
| Type | Description |
|---|---|
| bool | Returns |
IsHoverableBy(IXRHoverInteractor)
Determines if a given Interactor can hover over this Interactable.
Declaration
public override bool IsHoverableBy(IXRHoverInteractor interactor)
Parameters
| Type | Name | Description |
|---|---|---|
| IXRHoverInteractor | interactor | Interactor to check for a valid hover state with. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if hovering is valid this frame. Returns false if not. |
Overrides
See Also
IsSelectableBy(IXRSelectInteractor)
Determines if a given Interactor can select this Interactable.
Declaration
public override bool IsSelectableBy(IXRSelectInteractor interactor)
Parameters
| Type | Name | Description |
|---|---|---|
| IXRSelectInteractor | interactor | Interactor to check for a valid selection with. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if selection is valid this frame. Returns false if not. |
Overrides
See Also
OnContinueManipulation(DragGesture)
Unity calls this method automatically when the manipulation continues.
Declaration
protected virtual void OnContinueManipulation(DragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| DragGesture | gesture | The current gesture. |
See Also
OnContinueManipulation(PinchGesture)
Unity calls this method automatically when the manipulation continues.
Declaration
protected virtual void OnContinueManipulation(PinchGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| PinchGesture | gesture | The current gesture. |
See Also
OnContinueManipulation(TapGesture)
Unity calls this method automatically when the manipulation continues.
Declaration
protected virtual void OnContinueManipulation(TapGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TapGesture | gesture | The current gesture. |
See Also
OnContinueManipulation(TwistGesture)
Unity calls this method automatically when the manipulation continues.
Declaration
protected virtual void OnContinueManipulation(TwistGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwistGesture | gesture | The current gesture. |
See Also
OnContinueManipulation(TwoFingerDragGesture)
Unity calls this method automatically when the manipulation continues.
Declaration
protected virtual void OnContinueManipulation(TwoFingerDragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwoFingerDragGesture | gesture | The current gesture. |
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected override void OnEnable()
Overrides
OnEndManipulation(DragGesture)
Unity calls this method automatically when the manipulation ends.
Declaration
protected virtual void OnEndManipulation(DragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| DragGesture | gesture | The current gesture. |
See Also
OnEndManipulation(PinchGesture)
Unity calls this method automatically when the manipulation ends.
Declaration
protected virtual void OnEndManipulation(PinchGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| PinchGesture | gesture | The current gesture. |
See Also
OnEndManipulation(TapGesture)
Unity calls this method automatically when the manipulation ends.
Declaration
protected virtual void OnEndManipulation(TapGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TapGesture | gesture | The current gesture. |
See Also
OnEndManipulation(TwistGesture)
Unity calls this method automatically when the manipulation ends.
Declaration
protected virtual void OnEndManipulation(TwistGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwistGesture | gesture | The current gesture. |
See Also
OnEndManipulation(TwoFingerDragGesture)
Unity calls this method automatically when the manipulation ends.
Declaration
protected virtual void OnEndManipulation(TwoFingerDragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwoFingerDragGesture | gesture | The current gesture. |
See Also
OnRegistered(InteractableRegisteredEventArgs)
The XRInteractionManager calls this method when this Interactable is registered with it.
Declaration
protected override void OnRegistered(InteractableRegisteredEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| InteractableRegisteredEventArgs | args | Event data containing the Interaction Manager that registered this Interactable. |
Overrides
Remarks
args is only valid during this method call, do not hold a reference to it.
See Also
OnStartManipulation(DragGesture)
Unity calls this method automatically when the manipulation starts.
Declaration
protected virtual void OnStartManipulation(DragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| DragGesture | gesture | The current gesture. |
See Also
OnStartManipulation(PinchGesture)
Unity calls this method automatically when the manipulation starts.
Declaration
protected virtual void OnStartManipulation(PinchGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| PinchGesture | gesture | The current gesture. |
See Also
OnStartManipulation(TapGesture)
Unity calls this method automatically when the manipulation starts.
Declaration
protected virtual void OnStartManipulation(TapGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TapGesture | gesture | The current gesture. |
See Also
OnStartManipulation(TwistGesture)
Unity calls this method automatically when the manipulation starts.
Declaration
protected virtual void OnStartManipulation(TwistGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwistGesture | gesture | The current gesture. |
See Also
OnStartManipulation(TwoFingerDragGesture)
Unity calls this method automatically when the manipulation starts.
Declaration
protected virtual void OnStartManipulation(TwoFingerDragGesture gesture)
Parameters
| Type | Name | Description |
|---|---|---|
| TwoFingerDragGesture | gesture | The current gesture. |
See Also
OnUnregistered(InteractableUnregisteredEventArgs)
The XRInteractionManager calls this method when this Interactable is unregistered from it.
Declaration
protected override void OnUnregistered(InteractableUnregisteredEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| InteractableUnregisteredEventArgs | args | Event data containing the Interaction Manager that unregistered this Interactable. |
Overrides
Remarks
args is only valid during this method call, do not hold a reference to it.