Interface IGestureRecognizer
Interface for gesture recognizers.
A gesture recognizer decouples the logic for recognizing a sequence of touches (or other input) and acting on that recognition. When one of these objects recognizes a common gesture or, in some cases, a change in the gesture, it sends an action message to each designated target object.
Namespace: Unity.AppUI.Core
Assembly: Unity.AppUI.dll
Syntax
public interface IGestureRecognizer
Properties
hasChangedThisFrame
Whether the gesture recognizer state or outgoing value has changed this frame.
Declaration
bool hasChangedThisFrame { get; }
Property Value
Type | Description |
---|---|
bool |
state
The current state of the gesture recognizer.
The possible states a gesture recognizer can be in are represented by the values of type.
Some of these states aren’t applicable to discrete gestures.
Declaration
GestureRecognizerState state { get; }
Property Value
Type | Description |
---|---|
GestureRecognizerState |
Methods
Recognize(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
void Recognize(AppUITouch[] appuiTouches)
Parameters
Type | Name | Description |
---|---|---|
AppUITouch[] | appuiTouches | The current touch inputs for the current frame. |
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
void Reset()