Ejemplo n.º 1
0
 void UseAbilities()
 {
     if (Input.GetKeyDown(KeyCode.Joystick1Button1) && id == 1 ||
         Input.GetKeyDown(KeyCode.Joystick2Button1) && id == 2 ||
         Input.GetKeyDown(KeyCode.Joystick3Button1) && id == 3 ||
         Input.GetKeyDown(KeyCode.Joystick4Button1) && id == 4 ||
         Input.GetKeyDown(KeyCode.Joystick5Button1) && id == 5 ||
         Input.GetKeyDown(KeyCode.Joystick6Button1) && id == 6 ||
         Input.GetKeyDown(KeyCode.Joystick7Button1) && id == 7 ||
         Input.GetKeyDown(KeyCode.Joystick8Button1) && id == 8
         )
     {
         if (hasIncSpeedAbility)
         {
             specialAbilityController.IncSpeed();
             // if (onUseSpecialAbility != null) { onUseSpecialAbility(); }
         }
         else if (hasDecSpeedAbility)
         {
             specialAbilityController.DecSpeed();
             // if (onUseSpecialAbility != null) { onUseSpecialAbility(); }
         }
         else if (hasReverseControllerAbility)
         {
             specialAbilityController.ReverseControl();
             // if (onUseSpecialAbility != null) { onUseSpecialAbility(); }
         }
         else if (hasAttackAbility)
         {
             specialAbilityController.Attack();
             // if (onUseSpecialAbility != null) { onUseSpecialAbility(); }
         }
         else if (hasDefenedAbility)
         {
             specialAbilityController.Defened();
             // if (onUseSpecialAbility != null) { onUseSpecialAbility(); }
         }
     }
 }