Ejemplo n.º 1
0
 /*
  * Set fighter to blocking or unblocking depending on button up or down.
  */
 void TryBlock()
 {
     if (RBInput.GetAxisForPlayer(InputStrings.BLOCK, PlayerIndex, playerDevice) == 1 ||
         RBInput.GetButtonForPlayer(InputStrings.BLOCK, PlayerIndex, playerDevice))
     {
         fighter.Block();
     }
     else if (RBInput.GetAxisForPlayer(InputStrings.BLOCK, PlayerIndex, playerDevice) == 0 ||
              RBInput.GetButtonUpForPlayer(InputStrings.BLOCK, PlayerIndex, playerDevice))
     {
         if (fighter.IsBlocking)
         {
             fighter.UnBlock();
         }
     }
 }
Ejemplo n.º 2
0
 /*
  * Set fighter to blocking or unblocking depending on button up or down.
  */
 void TryBlock()
 {
     if (RBInput.GetAxisForPlayer(InputStrings.BLOCK, PlayerIndex) == 1 ||
         RBInput.GetButtonForPlayer(InputStrings.BLOCK, PlayerIndex))
     {
         fighter.Block();
     }
     else if (RBInput.GetAxisForPlayer(InputStrings.BLOCK, PlayerIndex) < 1 ||
              RBInput.GetButtonUpForPlayer(InputStrings.BLOCK, PlayerIndex))
     {
         if (fighter.isBlocking)
         {
             fighter.UnBlock(false);
         }
     }
 }