docs.unity3d.com
    Show / Hide Table of Contents

    Class ARBaseGestureInteractable

    Base class that manipulates an object via a gesture.

    Inheritance
    Object
    XRBaseInteractable
    ARBaseGestureInteractable
    ARAnnotationInteractable
    ARPlacementInteractable
    ARRotationInteractable
    ARScaleInteractable
    ARSelectionInteractable
    ARTranslationInteractable
    Inherited Members
    XRBaseInteractable.registered
    XRBaseInteractable.unregistered
    XRBaseInteractable.interactionManager
    XRBaseInteractable.colliders
    XRBaseInteractable.interactionLayerMask
    XRBaseInteractable.customReticle
    XRBaseInteractable.firstHoverEntered
    XRBaseInteractable.lastHoverExited
    XRBaseInteractable.hoverEntered
    XRBaseInteractable.hoverExited
    XRBaseInteractable.selectEntered
    XRBaseInteractable.selectExited
    XRBaseInteractable.activated
    XRBaseInteractable.deactivated
    XRBaseInteractable.hoveringInteractors
    XRBaseInteractable.selectingInteractor
    XRBaseInteractable.isHovered
    XRBaseInteractable.isSelected
    XRBaseInteractable.OnDisable()
    XRBaseInteractable.OnDestroy()
    XRBaseInteractable.GetDistanceSqrToInteractor(XRBaseInteractor)
    XRBaseInteractable.AttachCustomReticle(XRBaseInteractor)
    XRBaseInteractable.RemoveCustomReticle(XRBaseInteractor)
    XRBaseInteractable.ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase)
    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.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)
    Namespace: UnityEngine.XR.Interaction.Toolkit.AR
    Syntax
    public abstract class ARBaseGestureInteractable : XRBaseInteractable

    Properties

    arSessionOrigin

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

    Declaration
    public ARSessionOrigin arSessionOrigin { get; set; }
    Property Value
    Type Description
    ARSessionOrigin

    gestureInteractor

    The ARGestureInteractor whose gestures are listened to by this Interactable when connected.

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

    Methods

    Awake()

    See .

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

    CanStartManipulationForGesture(DragGesture)

    Determines if the manipulation can be started 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 be started. Otherwise, returns false.

    CanStartManipulationForGesture(PinchGesture)

    Determines if the manipulation can be started 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 be started. Otherwise, returns false.

    CanStartManipulationForGesture(TapGesture)

    Determines if the manipulation can be started 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 be started. Otherwise, returns false.

    CanStartManipulationForGesture(TwistGesture)

    Determines if the manipulation can be started 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 be started. Otherwise, returns false.

    CanStartManipulationForGesture(TwoFingerDragGesture)

    Determines if the manipulation can be started 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 be started. Otherwise, returns false.

    ConnectGestureInteractor()

    Connect an interactor's gestures to this interactable.

    Declaration
    protected virtual void ConnectGestureInteractor()

    DisconnectGestureInteractor()

    Disconnect an interactor's gestures from this interactable.

    Declaration
    protected virtual void DisconnectGestureInteractor()

    IsGameObjectSelected()

    Determines if the Gesture Interactor is selecting the this Interactable is attached to.

    Declaration
    protected virtual bool IsGameObjectSelected()
    Returns
    Type Description
    Boolean

    Returns if the Gesture Interactor is selecting the this Interactable is attached to. Otherwise, returns .

    IsHoverableBy(XRBaseInteractor)

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

    Declaration
    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)
    See Also
    CanHover(XRBaseInteractable)

    IsSelectableBy(XRBaseInteractor)

    Determines if this interactable can be selected by a given interactor.

    Declaration
    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)
    See Also
    CanSelect(XRBaseInteractable)

    OnContinueManipulation(DragGesture)

    Unity calls this method automatically when the manipulation is continued.

    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 is continued.

    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 is continued.

    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 is continued.

    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 is continued.

    Declaration
    protected virtual void OnContinueManipulation(TwoFingerDragGesture gesture)
    Parameters
    Type Name Description
    TwoFingerDragGesture gesture

    The current gesture.

    See Also
    onUpdated

    OnEnable()

    See .

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

    OnEndManipulation(DragGesture)

    Unity calls this method automatically when the manipulation is ended.

    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 is ended.

    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 is ended.

    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 is ended.

    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 is ended.

    Declaration
    protected virtual void OnEndManipulation(TwoFingerDragGesture gesture)
    Parameters
    Type Name Description
    TwoFingerDragGesture gesture

    The current gesture.

    See Also
    onFinished

    OnRegistered(InteractableRegisteredEventArgs)

    This method is called by the Interaction Manager 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(XRBaseInteractable)

    OnStartManipulation(DragGesture)

    Unity calls this method automatically when the manipulation is started.

    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 is started.

    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 is started.

    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 is started.

    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 is started.

    Declaration
    protected virtual void OnStartManipulation(TwoFingerDragGesture gesture)
    Parameters
    Type Name Description
    TwoFingerDragGesture gesture

    The current gesture.

    See Also
    onGestureStarted

    OnUnregistered(InteractableUnregisteredEventArgs)

    This method is called by the Interaction Manager 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(XRBaseInteractable)

    Reset()

    See .

    Declaration
    protected override void Reset()
    Overrides
    XRBaseInteractable.Reset()
    Back to top
    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