Class ARSelectionInteractable
Controls the selection of an object via a Tap gesture.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR
Syntax
[AddComponentMenu("XR/AR Selection Interactable", 22)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.AR.ARSelectionInteractable.html")]
public class ARSelectionInteractable : ARBaseGestureInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRInteractable
Properties
selectionVisualization
The visualization GameObject that will become active when the object is selected.
Declaration
public GameObject selectionVisualization { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
Methods
CanStartManipulationForGesture(TapGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected override bool CanStartManipulationForGesture(TapGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
TapGesture | gesture | The current gesture. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the manipulation can start. Otherwise, returns false. |
Overrides
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 |
---|---|
Boolean | Returns true if selection is valid this frame. Returns false if not. |
Overrides
See Also
IsSelectableBy(XRBaseInteractor)
(Deprecated) Determines if a given Interactor can select this Interactable.
Declaration
[Obsolete("IsSelectableBy(XRBaseInteractor) has been deprecated. Use IsSelectableBy(IXRSelectInteractor) instead.")]
public override bool IsSelectableBy(XRBaseInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | Interactor to check for a valid selection with. |
Returns
Type | Description |
---|---|
Boolean | Returns true if selection is valid this frame. Returns false if not. |
Overrides
Remarks
IsSelectableBy(XRBaseInteractor)
has been deprecated. Use IsSelectableBy(IXRSelectInteractor) instead.
See Also
OnEndManipulation(TapGesture)
Unity calls this method automatically when the manipulation ends.
Declaration
protected override void OnEndManipulation(TapGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
TapGesture | gesture | The current gesture. |
Overrides
See Also
OnSelectEntering(SelectEnterEventArgs)
The XRInteractionManager calls this method 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 Interactor that is initiating the selection. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnSelectExiting(SelectExitEventArgs)
The XRInteractionManager calls this method 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 Interactor that is ending the selection. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.