docs.unity3d.com
    Show / Hide Table of Contents

    Class ARGestureInteractor

    The ARGestureInteractor allows the user to manipulate virtual objects (select, translate, rotate, scale, and elevate) through gestures (tap, drag, twist, and pinch).

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    XRBaseInteractor
    ARGestureInteractor
    Inherited Members
    XRBaseInteractor.registered
    XRBaseInteractor.unregistered
    XRBaseInteractor.interactionManager
    XRBaseInteractor.interactionLayers
    XRBaseInteractor.attachTransform
    XRBaseInteractor.keepSelectedTargetValid
    XRBaseInteractor.startingSelectedInteractable
    XRBaseInteractor.startingTargetFilter
    XRBaseInteractor.hoverEntered
    XRBaseInteractor.hoverExited
    XRBaseInteractor.selectEntered
    XRBaseInteractor.selectExited
    XRBaseInteractor.targetFilter
    XRBaseInteractor.allowHover
    XRBaseInteractor.allowSelect
    XRBaseInteractor.isPerformingManualInteraction
    XRBaseInteractor.interactablesHovered
    XRBaseInteractor.hasHover
    XRBaseInteractor.interactablesSelected
    XRBaseInteractor.firstInteractableSelected
    XRBaseInteractor.hasSelection
    XRBaseInteractor.Start()
    XRBaseInteractor.OnDestroy()
    XRBaseInteractor.GetAttachTransform(IXRInteractable)
    XRBaseInteractor.GetAttachPoseOnSelect(IXRSelectInteractable)
    XRBaseInteractor.GetLocalAttachPoseOnSelect(IXRSelectInteractable)
    XRBaseInteractor.isHoverActive
    XRBaseInteractor.isSelectActive
    XRBaseInteractor.CanHover(IXRHoverInteractable)
    XRBaseInteractor.CanSelect(IXRSelectInteractable)
    XRBaseInteractor.IsHovering(IXRHoverInteractable)
    XRBaseInteractor.IsSelecting(IXRSelectInteractable)
    XRBaseInteractor.IsHovering(IXRInteractable)
    XRBaseInteractor.IsSelecting(IXRInteractable)
    XRBaseInteractor.selectedInteractableMovementTypeOverride
    XRBaseInteractor.CaptureAttachPose(IXRSelectInteractable)
    XRBaseInteractor.PreprocessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    XRBaseInteractor.IXRInteractor.OnRegistered(InteractorRegisteredEventArgs)
    XRBaseInteractor.IXRInteractor.OnUnregistered(InteractorUnregisteredEventArgs)
    XRBaseInteractor.IXRHoverInteractor.CanHover(IXRHoverInteractable)
    XRBaseInteractor.IXRHoverInteractor.OnHoverEntering(HoverEnterEventArgs)
    XRBaseInteractor.IXRHoverInteractor.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractor.IXRHoverInteractor.OnHoverExiting(HoverExitEventArgs)
    XRBaseInteractor.IXRHoverInteractor.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractor.IXRSelectInteractor.CanSelect(IXRSelectInteractable)
    XRBaseInteractor.IXRSelectInteractor.OnSelectEntering(SelectEnterEventArgs)
    XRBaseInteractor.IXRSelectInteractor.OnSelectEntered(SelectEnterEventArgs)
    XRBaseInteractor.IXRSelectInteractor.OnSelectExiting(SelectExitEventArgs)
    XRBaseInteractor.IXRSelectInteractor.OnSelectExited(SelectExitEventArgs)
    XRBaseInteractor.OnHoverEntering(HoverEnterEventArgs)
    XRBaseInteractor.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractor.OnHoverExiting(HoverExitEventArgs)
    XRBaseInteractor.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractor.OnSelectEntering(SelectEnterEventArgs)
    XRBaseInteractor.OnSelectEntered(SelectEnterEventArgs)
    XRBaseInteractor.OnSelectExiting(SelectExitEventArgs)
    XRBaseInteractor.OnSelectExited(SelectExitEventArgs)
    XRBaseInteractor.StartManualInteraction(IXRSelectInteractable)
    XRBaseInteractor.EndManualInteraction()
    XRBaseInteractor.interactionLayerMask
    XRBaseInteractor.enableInteractions
    XRBaseInteractor.onHoverEntered
    XRBaseInteractor.onHoverExited
    XRBaseInteractor.onSelectEntered
    XRBaseInteractor.onSelectExited
    XRBaseInteractor.onHoverEnter
    XRBaseInteractor.onHoverExit
    XRBaseInteractor.onSelectEnter
    XRBaseInteractor.onSelectExit
    XRBaseInteractor.OnHoverEntering(XRBaseInteractable)
    XRBaseInteractor.OnHoverEntered(XRBaseInteractable)
    XRBaseInteractor.OnHoverExiting(XRBaseInteractable)
    XRBaseInteractor.OnHoverExited(XRBaseInteractable)
    XRBaseInteractor.OnSelectEntering(XRBaseInteractable)
    XRBaseInteractor.OnSelectEntered(XRBaseInteractable)
    XRBaseInteractor.OnSelectExiting(XRBaseInteractable)
    XRBaseInteractor.OnSelectExited(XRBaseInteractable)
    XRBaseInteractor.selectTarget
    XRBaseInteractor.hoverTargets
    XRBaseInteractor.GetHoverTargets(List<XRBaseInteractable>)
    XRBaseInteractor.GetValidTargets(List<XRBaseInteractable>)
    XRBaseInteractor.CanHover(XRBaseInteractable)
    XRBaseInteractor.CanSelect(XRBaseInteractable)
    XRBaseInteractor.requireSelectExclusive
    XRBaseInteractor.StartManualInteraction(XRBaseInteractable)
    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
    [AddComponentMenu("XR/AR Gesture Interactor", 22)]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.1/api/UnityEngine.XR.Interaction.Toolkit.AR.ARGestureInteractor.html")]
    public class ARGestureInteractor : XRBaseInteractor, IXRHoverInteractor, IXRSelectInteractor, IXRInteractor
    Remarks

    To make use of this, add an ARGestureInteractor to your scene and an ARBaseGestureInteractable to any of your virtual objects.

    Properties

    arSessionOrigin

    The ARSessionOrigin that this Interactor 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

    dragGestureRecognizer

    (Read Only) The Drag gesture recognizer.

    Declaration
    public DragGestureRecognizer dragGestureRecognizer { get; }
    Property Value
    Type Description
    DragGestureRecognizer

    DragGestureRecognizer

    (Read Only) The Drag gesture recognizer.

    Declaration
    [Obsolete("DragGestureRecognizer has been deprecated. Use dragGestureRecognizer instead. (UnityUpgradable) -> dragGestureRecognizer")]
    public DragGestureRecognizer DragGestureRecognizer { get; }
    Property Value
    Type Description
    DragGestureRecognizer
    Remarks

    DragGestureRecognizer has been deprecated. Use dragGestureRecognizer instead.

    instance

    (Read Only) The ARGestureInteractor instance.

    Declaration
    [Obsolete("instance has been deprecated. Use ARBaseGestureInteractable.gestureInteractor instead of singleton.")]
    public static ARGestureInteractor instance { get; }
    Property Value
    Type Description
    ARGestureInteractor
    Remarks

    instance has been deprecated. Use gestureInteractor instead of singleton.

    Instance

    (Read Only) The ARGestureInteractor instance.

    Declaration
    [Obsolete("Instance has been deprecated. Use instance instead. (UnityUpgradable) -> instance")]
    public static ARGestureInteractor Instance { get; }
    Property Value
    Type Description
    ARGestureInteractor
    Remarks

    Instance has been deprecated. Use instance instead.

    pinchGestureRecognizer

    (Read Only) The Pinch gesture recognizer.

    Declaration
    public PinchGestureRecognizer pinchGestureRecognizer { get; }
    Property Value
    Type Description
    PinchGestureRecognizer

    PinchGestureRecognizer

    (Read Only) The Pinch gesture recognizer.

    Declaration
    [Obsolete("PinchGestureRecognizer has been deprecated. Use pinchGestureRecognizer instead. (UnityUpgradable) -> pinchGestureRecognizer")]
    public PinchGestureRecognizer PinchGestureRecognizer { get; }
    Property Value
    Type Description
    PinchGestureRecognizer
    Remarks

    PinchGestureRecognizer has been deprecated. Use pinchGestureRecognizer instead.

    tapGestureRecognizer

    (Read Only) The Tap gesture recognizer.

    Declaration
    public TapGestureRecognizer tapGestureRecognizer { get; }
    Property Value
    Type Description
    TapGestureRecognizer

    TapGestureRecognizer

    (Read Only) The Tap gesture recognizer.

    Declaration
    [Obsolete("TapGestureRecognizer has been deprecated. Use tapGestureRecognizer instead. (UnityUpgradable) -> tapGestureRecognizer")]
    public TapGestureRecognizer TapGestureRecognizer { get; }
    Property Value
    Type Description
    TapGestureRecognizer
    Remarks

    TapGestureRecognizer has been deprecated. Use tapGestureRecognizer instead.

    twistGestureRecognizer

    (Read Only) The Twist gesture recognizer.

    Declaration
    public TwistGestureRecognizer twistGestureRecognizer { get; }
    Property Value
    Type Description
    TwistGestureRecognizer

    TwistGestureRecognizer

    (Read Only) The Twist gesture recognizer.

    Declaration
    [Obsolete("TwistGestureRecognizer has been deprecated. Use twistGestureRecognizer instead. (UnityUpgradable) -> twistGestureRecognizer")]
    public TwistGestureRecognizer TwistGestureRecognizer { get; }
    Property Value
    Type Description
    TwistGestureRecognizer
    Remarks

    TwistGestureRecognizer has been deprecated. Use twistGestureRecognizer instead.

    twoFingerDragGestureRecognizer

    (Read Only) The two-finger Drag gesture recognizer.

    Declaration
    public TwoFingerDragGestureRecognizer twoFingerDragGestureRecognizer { get; }
    Property Value
    Type Description
    TwoFingerDragGestureRecognizer

    TwoFingerDragGestureRecognizer

    (Read Only) The two-finger Drag gesture recognizer.

    Declaration
    [Obsolete("TwoFingerDragGestureRecognizer has been deprecated. Use twoFingerDragGestureRecognizer instead. (UnityUpgradable) -> twoFingerDragGestureRecognizer")]
    public TwoFingerDragGestureRecognizer TwoFingerDragGestureRecognizer { get; }
    Property Value
    Type Description
    TwoFingerDragGestureRecognizer
    Remarks

    TwoFingerDragGestureRecognizer has been deprecated. Use twoFingerDragGestureRecognizer instead.

    xrOrigin

    The XROrigin that this Interactor 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
    XRBaseInteractor.Awake()

    GetValidTargets(List<IXRInteractable>)

    Retrieve the list of Interactables that this Interactor could possibly interact with this frame. This list is sorted by priority (with highest priority first).

    Declaration
    public override void GetValidTargets(List<IXRInteractable> validTargets)
    Parameters
    Type Name Description
    List<IXRInteractable> validTargets
    Overrides
    XRBaseInteractor.GetValidTargets(List<IXRInteractable>)
    Remarks

    When implementing this method, Unity expects you to clear targets before adding to it.

    OnDisable()

    See MonoBehaviour.

    Declaration
    protected override void OnDisable()
    Overrides
    XRBaseInteractor.OnDisable()

    OnEnable()

    See MonoBehaviour.

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

    OnRegistered(InteractorRegisteredEventArgs)

    The XRInteractionManager calls this method when this Interactor is registered with it.

    Declaration
    protected override void OnRegistered(InteractorRegisteredEventArgs args)
    Parameters
    Type Name Description
    InteractorRegisteredEventArgs args

    Event data containing the Interaction Manager that registered this Interactor.

    Overrides
    XRBaseInteractor.OnRegistered(InteractorRegisteredEventArgs)
    Remarks

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

    See Also
    RegisterInteractor(IXRInteractor)

    OnUnregistered(InteractorUnregisteredEventArgs)

    The XRInteractionManager calls this method when this Interactor is unregistered from it.

    Declaration
    protected override void OnUnregistered(InteractorUnregisteredEventArgs args)
    Parameters
    Type Name Description
    InteractorUnregisteredEventArgs args

    Event data containing the Interaction Manager that unregistered this Interactor.

    Overrides
    XRBaseInteractor.OnUnregistered(InteractorUnregisteredEventArgs)
    Remarks

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

    See Also
    UnregisterInteractor(IXRInteractor)

    ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)

    The XRInteractionManager calls this method to update the Interactor after interaction events occur.

    Declaration
    public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
    Parameters
    Type Name Description
    XRInteractionUpdateOrder.UpdatePhase updatePhase

    The update phase this is called during.

    Overrides
    XRBaseInteractor.ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    Remarks

    Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.

    See Also
    XRInteractionUpdateOrder.UpdatePhase
    ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase)

    PushARSessionOrigin()

    Passes the arSessionOrigin to the Gesture Recognizers.

    Declaration
    [Obsolete("PushARSessionOrigin has been deprecated. Use PushXROrigin instead for similar functionality.")]
    protected virtual void PushARSessionOrigin()
    See Also
    arSessionOrigin

    PushXROrigin()

    Passes the xrOrigin to the Gesture Recognizers.

    Declaration
    protected virtual void PushXROrigin()
    See Also
    xrOrigin

    Reset()

    See MonoBehaviour.

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

    UpdateGestureRecognizers()

    Update all Gesture Recognizers.

    Declaration
    protected virtual void UpdateGestureRecognizers()
    See Also
    Update()

    Extension Methods

    XRHoverInteractorExtensions.GetOldestInteractableHovered(IXRHoverInteractor)
    XRSelectInteractorExtensions.GetOldestInteractableSelected(IXRSelectInteractor)
    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