Exemplo n.º 1
0
 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);
         }
     }
 }
Exemplo n.º 2
0
    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 );
        }
    }
Exemplo n.º 3
0
    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);
            }
        }
    }