docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PinchGestureRecognizer

    A continuous gesture recognizer that interprets pinching gestures involving two touches. Uses initial distance threshold and movement angle (dot product) to differentiate from panning. Handles intermittent touch updates.

    Inheritance
    object
    GestureRecognizer<float>
    PinchGestureRecognizer
    Implements
    IGestureRecognizer
    Inherited Members
    GestureRecognizer<float>.state
    GestureRecognizer<float>.hasChangedThisFrame
    GestureRecognizer<float>.value
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Core
    Assembly: Unity.AppUI.dll
    Syntax
    public class PinchGestureRecognizer : GestureRecognizer<float>, IGestureRecognizer

    Methods

    Recognize(ReadOnlySpan<AppUITouch>)

    Main method to recognize a gesture.

    A concrete implementation of a gesture recognizer should override this method to recognize a gesture. The implementation should also assume that this method will be called every frame.

    Declaration
    public override void Recognize(ReadOnlySpan<AppUITouch> appuiTouches)
    Parameters
    Type Name Description
    ReadOnlySpan<AppUITouch> appuiTouches

    The current touch inputs for the current frame.

    Overrides
    GestureRecognizer<float>.Recognize(ReadOnlySpan<AppUITouch>)
    Remarks

    Sometimes, touch inputs can be lost from a frame to another (no AppUITouch event with an Ended or Canceled phase will be sent). The concrete implementation must aknowledge this and reset its state accordingly.

    Reset()

    Resets the gesture recognizer to its initial state.

    Declaration
    public override void Reset()
    Overrides
    GestureRecognizer<float>.Reset()

    Implements

    IGestureRecognizer
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)