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); } }
///---------------------------------------------------------------------------------- /// <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(); } }