Class PinchGesture
Gesture for when the user performs a two-finger pinch motion on the touch screen.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR
Syntax
public class PinchGesture : Gesture<PinchGesture>
Constructors
PinchGesture(PinchGestureRecognizer, Touch, Touch)
Initializes and returns an instance of PinchGesture.
Declaration
public PinchGesture(PinchGestureRecognizer recognizer, Touch touch1, Touch touch2)
Parameters
Type | Name | Description |
---|---|---|
PinchGestureRecognizer | recognizer | The gesture recognizer. |
Touch | touch1 | The first touch that started this gesture. |
Touch | touch2 | The second touch that started this gesture. |
PinchGesture(PinchGestureRecognizer, Touch, Touch)
Initializes and returns an instance of PinchGesture.
Declaration
public PinchGesture(PinchGestureRecognizer recognizer, Touch touch1, Touch touch2)
Parameters
Type | Name | Description |
---|---|---|
PinchGestureRecognizer | recognizer | The gesture recognizer. |
Touch | touch1 | The first touch that started this gesture. |
Touch | touch2 | The second touch that started this gesture. |
Properties
fingerId1
(Read Only) The id of the first finger used in this gesture.
Declaration
public int fingerId1 { get; }
Property Value
Type | Description |
---|---|
Int32 |
fingerId2
(Read Only) The id of the second finger used in this gesture.
Declaration
public int fingerId2 { get; }
Property Value
Type | Description |
---|---|
Int32 |
gap
(Read Only) The gap between then position of the first and second fingers.
Declaration
public float gap { get; }
Property Value
Type | Description |
---|---|
Single |
gapDelta
(Read Only) The gap delta between then position of the first and second fingers.
Declaration
public float gapDelta { get; }
Property Value
Type | Description |
---|---|
Single |
pinchRecognizer
(Read Only) The gesture recognizer.
Declaration
protected PinchGestureRecognizer pinchRecognizer { get; }
Property Value
Type | Description |
---|---|
PinchGestureRecognizer |
startPosition1
(Read Only) The screen position of the first finger where the gesture started.
Declaration
public Vector2 startPosition1 { get; }
Property Value
Type | Description |
---|---|
Vector2 |
startPosition2
(Read Only) The screen position of the second finger where the gesture started.
Declaration
public Vector2 startPosition2 { get; }
Property Value
Type | Description |
---|---|
Vector2 |
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
OnCancel()
This method is called automatically when this gesture is canceled.
Declaration
protected override void OnCancel()
Overrides
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
OnStart()
This method is called automatically when this gesture is started.
Declaration
protected override void OnStart()
Overrides
UpdateGesture()
Updates this gesture.
Declaration
protected override bool UpdateGesture()
Returns
Type | Description |
---|---|
Boolean | Returns true if the update was successful. Otherwise, returns false. |