예제 #1
0
 public void CheckAttackButton_P2()
 {
     if (InputPlayerController.AttackButton_P2() && player2.GetEnableAttack() &&
         player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAdelante &&
         player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAtras &&
         !InputPlayerController.CheckPressDeffenseButton_P2())
     {
         //Debug.Log("JUGADOR 2 ATAQUE ACTIVED");
         player2.SetControllerJoystick(true);
         if (player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P2() < 0)
         {
             player2.spritePlayerActual.PlayAnimation("Ataque Abajo Salto protagonista");
             enableMovementPlayer2 = false;
         }
         else if (player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P2() >= 0)
         {
             player2.spritePlayerActual.PlayAnimation("Ataque Salto protagonista");
             enableMovementPlayer2 = false;
         }
         else
         {
             if (!player2.GetIsDuck())
             {
                 player2.spritePlayerActual.PlayAnimation("Ataque protagonista");
                 enableMovementPlayer2 = false;
             }
             else if (player2.GetIsDuck())
             {
                 player2.spritePlayerActual.PlayAnimation("Ataque Agachado protagonista");
                 enableMovementPlayer2 = false;
             }
         }
     }
 }