A small extension class for using TouchScript gestures as Rx Observables in Unity.
- Put the class somewhere in your project
- That's it actually.
tapGesture.TappedAsObservable().Subscribe(x =>
{
HitData hit = ((TapGesture)x.Sender).GetScreenPositionHitData();
cameraController.MoveCamera(hit.Point);
});
screenTransformGesture.TransformedAsObservable().Subscribe(x =>
{
transform.position += screenTransformGesture.DeltaPosition;
});