Exemple #1
0
 void LateUpdate()
 {
     _input.Begin();
     _clickGesture.Update();
     _dragGesture.Update();
     _pinchGesture.Update();
     _input.End();
 }
Exemple #2
0
 public void Update()
 {
     mInput.Update();
     if (null != mClickGesture)
     {
         mClickGesture.Update();
     }
     if (null != mDragGesture)
     {
         mDragGesture.Update();
     }
     if (null != mPinchGesture)
     {
         mPinchGesture.Update();
     }
 }
Exemple #3
0
    public void VerifyPinch(System.Action <string> Debug)
    {
        if (_currentPinch != null && !_currentPinch.IsValid)
        {
            Debug("Old Pinch was Invalid");
            _currentPinch = null;
        }

        if (_currentDrags.Count == 2)
        {
            Debug("2 drags " + Time.unscaledTime);
            var values = _currentDrags.Values.GetEnumerator();
            values.MoveNext();
            var first = values.Current;
            values.MoveNext();
            var second = values.Current;

            if (_currentPinch != null && !_currentPinch.Has(first, second))
            {
                Debug("Old Pinch was Invalid(2)");
                _currentPinch.TryDestroy();
                _currentPinch = null;
            }

            if (_currentPinch == null)
            {
                Debug("Create new Pinch " + (first != null) + " " + (second != null));
                _currentPinch = new PinchGesture(first, second);
                Trigger(_pinchListeners, _currentPinch);
            }
            else
            {
                _currentPinch.Update();
            }
        }
        else if (_currentPinch != null)
        {
            Debug("Old Pinch was Invalid(3)");
            _currentPinch.TryDestroy();
            _currentPinch = null;
        }
    }