Ejemplo n.º 1
0
 public void Reset()
 {
     CurrentState        = new GamePadState[4];
     PreviousState       = new GamePadState[4];
     CurrentButtonState  = new GamePadButtonState[4];
     PreviousButtonState = new GamePadButtonState[4];
 }
Ejemplo n.º 2
0
 public GamePadManager()
 {
     IsEnabled           = true;
     CurrentState        = new GamePadState[4];
     PreviousState       = new GamePadState[4];
     CurrentButtonState  = new GamePadButtonState[4];
     PreviousButtonState = new GamePadButtonState[4];
 }
Ejemplo n.º 3
0
 public void Update(GameTime gameTime)
 {
     for (var i = 0; i < 4; i++)
     {
         PreviousState[i]       = CurrentState[i];
         CurrentState[i]        = GamePad.GetState((PlayerIndex)i);
         PreviousButtonState[i] = CurrentButtonState[i];
         if (CurrentButtonState[i] == null)
         {
             CurrentButtonState[i] = new GamePadButtonState();
         }
         CurrentButtonState[i].Update(CurrentState[i]);
     }
 }