コード例 #1
0
 public void CheckAttackButton_P1()
 {
     if (InputPlayerController.AttackButton_P1() && player1.GetEnableAttack() &&
         player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAdelante &&
         player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAtras &&
         !InputPlayerController.CheckPressDeffenseButton_P1())
     {
         //Debug.Log("JUGADOR 1 ATAQUE ACTIVED");
         player1.SetControllerJoystick(true);
         if (player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P1() < 0)
         {
             player1.spritePlayerActual.PlayAnimation("Ataque Abajo Salto protagonista");
             enableMovementPlayer1 = false;
         }
         else if (player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P1() >= 0)
         {
             player1.spritePlayerActual.PlayAnimation("Ataque Salto protagonista");
             enableMovementPlayer1 = false;
         }
         else
         {
             if (!player1.GetIsDuck())
             {
                 player1.spritePlayerActual.PlayAnimation("Ataque protagonista");
                 enableMovementPlayer1 = false;
             }
             else if (player1.GetIsDuck())
             {
                 player1.spritePlayerActual.PlayAnimation("Ataque Agachado protagonista");
                 enableMovementPlayer1 = false;
             }
         }
     }
 }