Class Gesture<T>
A Gesture represents a sequence of touch events that are detected to represent a particular type of motion (e.g. Dragging, Pinching).
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public abstract class Gesture<T> where T : Gesture<T>
Type Parameters
| Name | Description |
|---|---|
| T | The actual gesture. |
Remarks
Gestures are created and updated by instances of GestureRecognizer<T>.
Properties
isCanceled
(Read Only) A boolean value indicating whether the gesture was canceled.
Declaration
public bool isCanceled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
recognizer
(Read Only) The gesture recognizer.
Declaration
protected GestureRecognizer<T> recognizer { get; }
Property Value
| Type | Description |
|---|---|
| GestureRecognizer<T> |
targetObject
(Read Only) The GameObject this gesture is targeting.
Declaration
public GameObject targetObject { get; protected set; }
Property Value
| Type | Description |
|---|---|
| GameObject |
Methods
CanStart()
Returns true if this gesture can start.
Declaration
protected abstract bool CanStart()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the gesture can start. Otherwise, returns false. |
Complete()
Completes this gesture.
Declaration
protected void Complete()
OnCancel()
This method is called automatically when this gesture is canceled.
Declaration
protected abstract void 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 abstract void OnFinish()
OnStart()
This method is called automatically when this gesture is started.
Declaration
protected abstract void OnStart()
UpdateGesture()
Updates this gesture.
Declaration
protected abstract bool UpdateGesture()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the update was successful. Otherwise, returns false. |
Events
onFinished
Calls the methods in its invocation list when a gesture is finished.
Declaration
public event Action<T> onFinished
Event Type
| Type | Description |
|---|---|
| Action<T> |
onStart
Calls the methods in its invocation list when a gesture is started.
Declaration
public event Action<T> onStart
Event Type
| Type | Description |
|---|---|
| Action<T> |
onUpdated
Calls the methods in its invocation list when a gesture is successfully updated.
Declaration
public event Action<T> onUpdated
Event Type
| Type | Description |
|---|---|
| Action<T> |