docs.unity3d.com
    Show / Hide Table of Contents

    Class TapGesture

    Gesture for when the user performs a tap on the touch screen.

    Inheritance
    Object
    Gesture<TapGesture>
    TapGesture
    Inherited Members
    Gesture<TapGesture>.onStart
    Gesture<TapGesture>.onUpdated
    Gesture<TapGesture>.onFinished
    Gesture<TapGesture>.isCanceled
    Gesture<TapGesture>.targetObject
    Gesture<TapGesture>.recognizer
    Gesture<TapGesture>.Complete()
    Gesture<TapGesture>.WasCancelled
    Gesture<TapGesture>.TargetObject
    Gesture<TapGesture>.m_Recognizer
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.AR
    Syntax
    public class TapGesture : Gesture<TapGesture>

    Constructors

    TapGesture(TapGestureRecognizer, Touch)

    Initializes and returns an instance of TapGesture.

    Declaration
    public TapGesture(TapGestureRecognizer recognizer, Touch touch)
    Parameters
    Type Name Description
    TapGestureRecognizer recognizer

    The gesture recognizer.

    Touch touch

    The touch that started this gesture.

    TapGesture(TapGestureRecognizer, Touch)

    Initializes and returns an instance of TapGesture.

    Declaration
    public TapGesture(TapGestureRecognizer recognizer, Touch touch)
    Parameters
    Type Name Description
    TapGestureRecognizer recognizer

    The gesture recognizer.

    Touch touch

    The touch that started this gesture.

    Properties

    fingerId

    (Read Only) The id of the finger used in this gesture.

    Declaration
    public int fingerId { get; }
    Property Value
    Type Description
    Int32

    startPosition

    (Read Only) The screen position where the gesture started.

    Declaration
    public Vector2 startPosition { get; }
    Property Value
    Type Description
    Vector2

    tapRecognizer

    (Read Only) The gesture recognizer.

    Declaration
    protected TapGestureRecognizer tapRecognizer { get; }
    Property Value
    Type Description
    TapGestureRecognizer

    Methods

    CanStart()

    Returns true if this gesture can start.

    Declaration
    protected override bool CanStart()
    Returns
    Type Description
    Boolean

    Returns true if the gesture can start. Otherwise, returns false.

    Overrides
    UnityEngine.XR.Interaction.Toolkit.AR.Gesture<UnityEngine.XR.Interaction.Toolkit.AR.TapGesture>.CanStart()

    OnCancel()

    This method is called automatically when this gesture is canceled.

    Declaration
    protected override void OnCancel()
    Overrides
    UnityEngine.XR.Interaction.Toolkit.AR.Gesture<UnityEngine.XR.Interaction.Toolkit.AR.TapGesture>.OnCancel()
    Remarks

    When canceled, this method is called right before OnFinish(), which is still invoked.

    OnFinish()

    This method is called automatically when this gesture is finished.

    Declaration
    protected override void OnFinish()
    Overrides
    UnityEngine.XR.Interaction.Toolkit.AR.Gesture<UnityEngine.XR.Interaction.Toolkit.AR.TapGesture>.OnFinish()

    OnStart()

    This method is called automatically when this gesture is started.

    Declaration
    protected override void OnStart()
    Overrides
    UnityEngine.XR.Interaction.Toolkit.AR.Gesture<UnityEngine.XR.Interaction.Toolkit.AR.TapGesture>.OnStart()

    UpdateGesture()

    Updates this gesture.

    Declaration
    protected override bool UpdateGesture()
    Returns
    Type Description
    Boolean

    Returns true if the update was successful. Otherwise, returns false.

    Overrides
    UnityEngine.XR.Interaction.Toolkit.AR.Gesture<UnityEngine.XR.Interaction.Toolkit.AR.TapGesture>.UpdateGesture()
    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