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));
 }
Пример #2
0
        private void OnEnable()
        {
            gesture = GetComponent <TransformGestureBase>();
            gesture.StateChanged += stateChangedHandler;
            TouchManager.Instance.FrameFinished += frameFinishedHandler;

            stateIdle();
        }
Пример #3
0
 public override void OnRegister()
 {
     transformGesture = GetComponent <TransformGestureBase>();
     longPressGesture = GetComponent <LongPressGesture>();
     if (transformGesture != null)
     {
         transformGesture.Transformed += OnTransformGesture;
     }
     longPressGesture.StateChanged += ShowMenu;
 }
Пример #4
0
        private void OnEnable()
        {
            gesture = GetComponent <TransformGestureBase>();
            gesture.StateChanged += stateChangedHandler;
            var touchManager = TouchManager.Instance;

            if (touchManager != null)
            {
                touchManager.FrameFinished += frameFinishedHandler;
            }

            stateIdle();
        }
Пример #5
0
 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;
     }
 }