예제 #1
0
    void UpdatePerFinger()
    {
        for (int i = 0; i < EasyFingerGestues.instance.mFingers.Length; i++)
        {
            Finger      finger  = EasyFingerGestues.instance.mFingers[i];
            T           gesture = _gestures[0];
            CFingerList touches = tempTouches;
            touches.Clear();


            if (finger.IsDown())
            {
                touches.Add(finger);
            }

            if (gesture.state == GestureState.Ready)
            {
                if (CanBegin(gesture, touches))
                {
                    Begin(gesture, touches);
                }
            }

            UpdateGesture(gesture, touches);
        }
    }
예제 #2
0
    ///----------------------------------------------------------------------------------
    /// <summary>
    /// 更新某个手指的位置信息,用来判断手势的输出
    /// </summary>
    ///----------------------------------------------------------------------------------
    private void UpdateFingers()
    {
        if (mInputProvider != null)
        {
            mInputProvider.Update();
        }

        mTouches.Clear();
        for (int i = 0; i < mFingers.Length; ++i)
        {
            Finger  finger = mFingers[i];
            Vector2 pos    = Vector2.zero;
            bool    IsDown = false;

            mInputProvider.GetInputState(finger.fingerIndex, out IsDown, out pos);
            finger.Update(IsDown, pos);

            if (finger.IsDown())
            {
                mTouches.Add(finger);
            }
        }

        for (int i = 0; i < mRecognizer.Count; i++)
        {
            mRecognizer[i].Update();
        }
    }