/TouchScriptRxExtensions

A small extension class for using TouchScript gestures as UniRx Observables in Unity

Primary LanguageC#MIT LicenseMIT

TouchScriptRxExtensions

A small extension class for using TouchScript gestures as Rx Observables in Unity.

Prerequisites

Usage

  1. Put the class somewhere in your project
  2. That's it actually.

Example

tapGesture.TappedAsObservable().Subscribe(x =>
{
    HitData hit = ((TapGesture)x.Sender).GetScreenPositionHitData();
    cameraController.MoveCamera(hit.Point);
});

screenTransformGesture.TransformedAsObservable().Subscribe(x =>
{
    transform.position += screenTransformGesture.DeltaPosition;
});