Example #1
0
    public void Feed(XTouchItem touch)
    {
        _one    |= OneUpdate(touch);
        _one_up |= OneUpUpdate(touch);

        if ((!_bFreeze) && ((_finger_id == -1 && touch.FingerId != XVirtualTab.singleton.FingerId) || _finger_id == touch.FingerId))
        {
            if (touch.Phase == TouchPhase.Began)
            {
                _start       = touch.Position;
                _swype_start = _start;
                _bTouch      = true;
            }

            if (_bTouch)
            {
                if (XTouch.IsActiveTouch(touch))
                {
                    _gesturepos = touch.Position;
                    _bswype     = SwypeUpdate(touch);
                    if (_bswype)
                    {
                        _finger_id = touch.FingerId;
                    }
                }
                else
                {
                    Cancel();
                }
            }
        }
    }
Example #2
0
 public void Feed(XTouchItem touch)
 {
     if (!_bFreeze && ((_finger_id == -1 && touch.FingerId != XGesture.singleton.FingerId) || _finger_id == touch.FingerId))
     {
         if (_bFeeding)
         {
             if (XTouch.IsActiveTouch(touch))
             {
                 CalcMove(touch, false);
             }
             else
             {
                 Cancel();
             }
         }
         else
         {
             if (_bTouch)
             {
                 if (XTouch.IsActiveTouch(touch))
                 {
                     Vector2 delta = touch.Position - _center;
                     if (delta.sqrMagnitude > _dead_zone * _dead_zone)
                     {
                         _bFeeding = true;
                         CalcMove(touch, true);
                     }
                 }
                 else
                 {
                     Cancel();
                 }
             }
             else
             {
                 if (touch.Phase == TouchPhase.Began && touch.Position.x < Screen.width * 0.5f)
                 {
                     _bTouch    = true;
                     _center    = touch.Position;
                     _finger_id = touch.FingerId;
                 }
             }
         }
     }
 }