示例#1
0
 void ScanForAbilityKeyDown()
 {
     for (int keyIndex = 1; keyIndex <= abilities.GetNumbersOfAbilities(); keyIndex++)
     {
         if (Input.GetKeyDown(keyIndex.ToString()))
         {
             abilities.AttemptSpecialAbility(keyIndex);
         }
     }
 }
示例#2
0
 private void OnMouseOverEnemy(EnemyAI enemyAi)
 {
     if (Input.GetMouseButton(0) && IsTargetInRange(enemyAi.gameObject))
     {
         _weaponSystem.SetAndAttackTarget(enemyAi.gameObject);
     }
     if (Input.GetMouseButton(0) && !IsTargetInRange(enemyAi.gameObject))
     {
         StartCoroutine(MoveAndAttack(enemyAi.gameObject));
     }
     if (Input.GetMouseButtonDown(1) && IsTargetInRange(enemyAi.gameObject))
     {
         _powerAttackAbilityIndex = 2;
         _specialAbilities.AttemptSpecialAbility(_powerAttackAbilityIndex, enemyAi.gameObject);
     }
     if (Input.GetMouseButton(1) && !IsTargetInRange(enemyAi.gameObject))
     {
         StartCoroutine(MoveAndPowerAttack(enemyAi.gameObject));
     }
 }