public static IObservable <EventPattern <EventArgs> > TransformedAsObservable(this TransformGestureBase gesture) { return(Observable.FromEventPattern <EventHandler <EventArgs>, EventArgs>( h => h.Invoke, h => gesture.Transformed += h, h => gesture.Transformed -= h)); }
private void OnEnable() { gesture = GetComponent <TransformGestureBase>(); gesture.StateChanged += stateChangedHandler; TouchManager.Instance.FrameFinished += frameFinishedHandler; stateIdle(); }
public override void OnRegister() { transformGesture = GetComponent <TransformGestureBase>(); longPressGesture = GetComponent <LongPressGesture>(); if (transformGesture != null) { transformGesture.Transformed += OnTransformGesture; } longPressGesture.StateChanged += ShowMenu; }
private void OnEnable() { gesture = GetComponent <TransformGestureBase>(); gesture.StateChanged += stateChangedHandler; var touchManager = TouchManager.Instance; if (touchManager != null) { touchManager.FrameFinished += frameFinishedHandler; } stateIdle(); }
protected virtual void Start() { if (viewer == null) { viewer = Camera.main.transform; } if (target == null) { target = transform; } if (gesture == null) { gesture = FindObjectOfType <TransformGestureBase>(); } // if (gesture != null) { gesture.TransformStarted += OnTransformStarted; gesture.Transformed += OnTransformed; gesture.TransformCompleted += OnTransformCompleted; } }