void UpdateFingers() { touches.Clear(); // 更新所有手指 for (int i = 0; i < fingers.Length; ++i) { Finger finger = fingers[i]; UnityEngine.Vector2 pos = UnityEngine.Vector2.zero; bool down = false; // 刷新输入状态 inputProvider.GetInputState(finger.Index, out down, out pos); finger.Update(down, pos); if (finger.IsDown) { touches.Add(finger); } } }
void UpdateFingers() { touches.Clear(); // update all fingers foreach( Finger finger in fingers ) { Vector2 pos = Vector2.zero; bool down = false; // request fresh input state from provider inputProvider.GetInputState( finger.Index, out down, out pos ); finger.Update( down, pos ); if( finger.IsDown ) touches.Add( finger ); } }
void UpdateFingers() { touches.Clear(); // update all fingers for (int i = 0; i < fingers.Length; ++i) { Finger finger = fingers[i]; Vector2 pos = Vector2.zero; bool down = false; // request fresh input state from provider inputProvider.GetInputState(finger.Index, out down, out pos); finger.Update(down, pos); if (finger.IsDown) { touches.Add(finger); } } }