docs.unity3d.com
    Show / Hide Table of Contents

    Class ARBaseGestureInteractable

    Base class that manipulates an object via a gesture.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    XRBaseInteractable
    ARBaseGestureInteractable
    ARAnnotationInteractable
    ARPlacementInteractable
    ARRotationInteractable
    ARScaleInteractable
    ARSelectionInteractable
    ARTranslationInteractable
    Inherited Members
    XRBaseInteractable.registered
    XRBaseInteractable.unregistered
    XRBaseInteractable.getDistanceOverride
    XRBaseInteractable.interactionManager
    XRBaseInteractable.colliders
    XRBaseInteractable.interactionLayers
    XRBaseInteractable.distanceCalculationMode
    XRBaseInteractable.selectMode
    XRBaseInteractable.customReticle
    XRBaseInteractable.firstHoverEntered
    XRBaseInteractable.lastHoverExited
    XRBaseInteractable.hoverEntered
    XRBaseInteractable.hoverExited
    XRBaseInteractable.firstSelectEntered
    XRBaseInteractable.lastSelectExited
    XRBaseInteractable.selectEntered
    XRBaseInteractable.selectExited
    XRBaseInteractable.activated
    XRBaseInteractable.deactivated
    XRBaseInteractable.interactorsHovering
    XRBaseInteractable.isHovered
    XRBaseInteractable.interactorsSelecting
    XRBaseInteractable.firstInteractorSelecting
    XRBaseInteractable.isSelected
    XRBaseInteractable.OnDisable()
    XRBaseInteractable.OnDestroy()
    XRBaseInteractable.GetAttachTransform(IXRInteractor)
    XRBaseInteractable.GetAttachPoseOnSelect(IXRSelectInteractor)
    XRBaseInteractable.GetLocalAttachPoseOnSelect(IXRSelectInteractor)
    XRBaseInteractable.GetDistanceSqrToInteractor(IXRInteractor)
    XRBaseInteractable.GetDistance(Vector3)
    XRBaseInteractable.AttachCustomReticle(IXRInteractor)
    XRBaseInteractable.RemoveCustomReticle(IXRInteractor)
    XRBaseInteractable.CaptureAttachPose(IXRSelectInteractor)
    XRBaseInteractable.ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase)
    XRBaseInteractable.IXRInteractable.OnRegistered(InteractableRegisteredEventArgs)
    XRBaseInteractable.IXRInteractable.OnUnregistered(InteractableUnregisteredEventArgs)
    XRBaseInteractable.IXRActivateInteractable.OnActivated(ActivateEventArgs)
    XRBaseInteractable.IXRActivateInteractable.OnDeactivated(DeactivateEventArgs)
    XRBaseInteractable.IXRHoverInteractable.IsHoverableBy(IXRHoverInteractor)
    XRBaseInteractable.IXRHoverInteractable.OnHoverEntering(HoverEnterEventArgs)
    XRBaseInteractable.IXRHoverInteractable.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractable.IXRHoverInteractable.OnHoverExiting(HoverExitEventArgs)
    XRBaseInteractable.IXRHoverInteractable.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractable.IXRSelectInteractable.IsSelectableBy(IXRSelectInteractor)
    XRBaseInteractable.IXRSelectInteractable.OnSelectEntering(SelectEnterEventArgs)
    XRBaseInteractable.IXRSelectInteractable.OnSelectEntered(SelectEnterEventArgs)
    XRBaseInteractable.IXRSelectInteractable.OnSelectExiting(SelectExitEventArgs)
    XRBaseInteractable.IXRSelectInteractable.OnSelectExited(SelectExitEventArgs)
    XRBaseInteractable.OnHoverEntering(HoverEnterEventArgs)
    XRBaseInteractable.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractable.OnHoverExiting(HoverExitEventArgs)
    XRBaseInteractable.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractable.OnSelectEntering(SelectEnterEventArgs)
    XRBaseInteractable.OnSelectEntered(SelectEnterEventArgs)
    XRBaseInteractable.OnSelectExiting(SelectExitEventArgs)
    XRBaseInteractable.OnSelectExited(SelectExitEventArgs)
    XRBaseInteractable.OnActivated(ActivateEventArgs)
    XRBaseInteractable.OnDeactivated(DeactivateEventArgs)
    XRBaseInteractable.interactionLayerMask
    XRBaseInteractable.onFirstHoverEntered
    XRBaseInteractable.onLastHoverExited
    XRBaseInteractable.onHoverEntered
    XRBaseInteractable.onHoverExited
    XRBaseInteractable.onSelectEntered
    XRBaseInteractable.onSelectExited
    XRBaseInteractable.onSelectCanceled
    XRBaseInteractable.onActivate
    XRBaseInteractable.onDeactivate
    XRBaseInteractable.onFirstHoverEnter
    XRBaseInteractable.onHoverEnter
    XRBaseInteractable.onHoverExit
    XRBaseInteractable.onLastHoverExit
    XRBaseInteractable.onSelectEnter
    XRBaseInteractable.onSelectExit
    XRBaseInteractable.onSelectCancel
    XRBaseInteractable.OnHoverEntering(XRBaseInteractor)
    XRBaseInteractable.OnHoverEntered(XRBaseInteractor)
    XRBaseInteractable.OnHoverExiting(XRBaseInteractor)
    XRBaseInteractable.OnHoverExited(XRBaseInteractor)
    XRBaseInteractable.OnSelectEntering(XRBaseInteractor)
    XRBaseInteractable.OnSelectEntered(XRBaseInteractor)
    XRBaseInteractable.OnSelectExiting(XRBaseInteractor)
    XRBaseInteractable.OnSelectExited(XRBaseInteractor)
    XRBaseInteractable.OnSelectCanceling(XRBaseInteractor)
    XRBaseInteractable.OnSelectCanceled(XRBaseInteractor)
    XRBaseInteractable.OnActivate(XRBaseInteractor)
    XRBaseInteractable.OnDeactivate(XRBaseInteractor)
    XRBaseInteractable.GetDistanceSqrToInteractor(XRBaseInteractor)
    XRBaseInteractable.AttachCustomReticle(XRBaseInteractor)
    XRBaseInteractable.RemoveCustomReticle(XRBaseInteractor)
    XRBaseInteractable.hoveringInteractors
    XRBaseInteractable.selectingInteractor
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(String)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(Object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    Component.SendMessageUpwards(String, Object, SendMessageOptions)
    Component.SendMessageUpwards(String, Object)
    Component.SendMessageUpwards(String)
    Component.SendMessageUpwards(String, SendMessageOptions)
    Component.SendMessage(String, Object)
    Component.SendMessage(String)
    Component.SendMessage(String, Object, SendMessageOptions)
    Component.SendMessage(String, SendMessageOptions)
    Component.BroadcastMessage(String, Object, SendMessageOptions)
    Component.BroadcastMessage(String, Object)
    Component.BroadcastMessage(String)
    Component.BroadcastMessage(String, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Component.rigidbody
    Component.rigidbody2D
    Component.camera
    Component.light
    Component.animation
    Component.constantForce
    Component.renderer
    Component.audio
    Component.networkView
    Component.collider
    Component.collider2D
    Component.hingeJoint
    Component.particleSystem
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.AR
    Syntax
    public abstract class ARBaseGestureInteractable : XRBaseInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRInteractable

    Properties

    arSessionOrigin

    The ARSessionOrigin that this Interactable will use (such as to get the Camera or to transform from Session space). Will find one if null.

    Declaration
    [Obsolete("arSessionOrigin is marked for deprecation and will be removed in a future version. Please use xrOrigin instead.")]
    public ARSessionOrigin arSessionOrigin { get; set; }
    Property Value
    Type Description
    ARSessionOrigin

    gestureInteractor

    The ARGestureInteractor that this Interactable listens to for gestures when connected.

    Declaration
    protected ARGestureInteractor gestureInteractor { get; }
    Property Value
    Type Description
    ARGestureInteractor
    See Also
    ConnectGestureInteractor()
    DisconnectGestureInteractor()

    xrOrigin

    The 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
    XRBaseInteractable.Awake()

    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
    Boolean

    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
    Boolean

    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
    Boolean

    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
    Boolean

    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
    Boolean

    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
    Boolean

    Returns if the Gesture Interactor is selecting the GameObject this Interactable is attached to. Otherwise, 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
    Boolean

    Returns true if hovering is valid this frame. Returns false if not.

    Overrides
    XRBaseInteractable.IsHoverableBy(IXRHoverInteractor)
    See Also
    CanHover(IXRHoverInteractable)

    IsHoverableBy(XRBaseInteractor)

    (Deprecated) Determines if this interactable can be hovered by a given interactor.

    Declaration
    [Obsolete("IsHoverableBy(XRBaseInteractor) has been deprecated. Use IsHoverableBy(IXRHoverInteractor) instead.")]
    public override bool IsHoverableBy(XRBaseInteractor interactor)
    Parameters
    Type Name Description
    XRBaseInteractor interactor

    Interactor to check for a valid hover state with.

    Returns
    Type Description
    Boolean

    Returns true if hovering is valid this frame. Returns false if not.

    Overrides
    XRBaseInteractable.IsHoverableBy(XRBaseInteractor)
    Remarks

    IsHoverableBy(XRBaseInteractor) has been deprecated. Use IsHoverableBy(IXRHoverInteractor) instead.

    See Also
    CanHover(XRBaseInteractable)

    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
    XRBaseInteractable.IsSelectableBy(IXRSelectInteractor)
    See Also
    CanSelect(IXRSelectInteractable)

    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
    XRBaseInteractable.IsSelectableBy(XRBaseInteractor)
    Remarks

    IsSelectableBy(XRBaseInteractor) has been deprecated. Use IsSelectableBy(IXRSelectInteractor) instead.

    See Also
    CanSelect(XRBaseInteractable)

    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
    onUpdated

    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
    onUpdated

    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
    onUpdated

    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
    onUpdated

    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
    onUpdated

    OnEnable()

    See MonoBehaviour.

    Declaration
    protected override void OnEnable()
    Overrides
    XRBaseInteractable.OnEnable()

    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
    onFinished

    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
    onFinished

    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
    onFinished

    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
    onFinished

    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
    onFinished

    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
    XRBaseInteractable.OnRegistered(InteractableRegisteredEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    RegisterInteractable(IXRInteractable)

    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
    onGestureStarted

    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
    onGestureStarted

    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
    onGestureStarted

    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
    onGestureStarted

    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
    onGestureStarted

    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
    XRBaseInteractable.OnUnregistered(InteractableUnregisteredEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    UnregisterInteractable(IXRInteractable)

    Reset()

    See MonoBehaviour.

    Declaration
    protected override void Reset()
    Overrides
    XRBaseInteractable.Reset()

    Extension Methods

    XRHoverInteractableExtensions.GetOldestInteractorHovering(IXRHoverInteractable)
    XRSelectInteractableExtensions.GetOldestInteractorSelecting(IXRSelectInteractable)
    Back to top
    Terms of use
    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