コード例 #1
0
 //Custom
 void OnKeyPress(int _key)
 {
     if (_key == 0 ||
         _key >= abilities.GetNumberOfAbilities())
     {
         return;
     }
     abilities.AttemptSpecialAbility(_key);
 }
コード例 #2
0
 private void ScanForAbilityKeyDown()
 {
     for (int keyIndex = 0; keyIndex < abilities.GetNumberOfAbilities(); keyIndex++)
     {
         if (Input.GetKeyDown(keyIndex.ToString()))
         {
             abilities.AttemptSpecialAbility(keyIndex);
         }
     }
 }
コード例 #3
0
 private void ScanForAbilityKeyDown()
 {
     for (int i = 0; i < abilities.GetNumberOfAbilities(); i++)
     {
         if (abilities.abilities[i] && Input.GetKeyDown(abilities.abilities[i].ButtonName))
         {
             abilities.AttemptSpecialAbility(i);
         }
     }
 }
コード例 #4
0
 void ScanForAbilityKeyDown()
 {
     for (int key = 1; key < specialAbilities.getNumberOfAbilities(); key++)
     {
         if (Input.GetKeyDown(key.ToString()))
         {
             specialAbilities.AttemptSpecialAbility(key);
             currentAbilityIndex = key;
         }
     }
 }
コード例 #5
0
        void OnMouseOverEnemy(EnemyAI enemyToSet)
        {
            this.target = enemyToSet;
            HealthSystem enemyCharacterHealth = this.target.GetComponent <HealthSystem>();

            if (Input.GetMouseButton(0) && playerCharacter.IsTargetInRange(enemyCharacterHealth.GetComponent <Character>()))
            {
                weaponSystem.AttackTarget(enemyCharacterHealth);
            }
            else if (Input.GetMouseButtonDown(1) && playerCharacter.IsTargetInRange(enemyCharacterHealth.GetComponent <Character>()))
            {
                playerAbilities.AttemptSpecialAbility(0, enemyCharacterHealth, characterStats.GetDamage());
            }
        }
コード例 #6
0
 void OnMouseOverEnemy(EnemyAI enemy)
 {
     if (Input.GetMouseButton(0) && IsTargetInRange(enemy.gameObject))
     {
         weaponSystem.AttackTarget(enemy.gameObject);
     }
     else if (Input.GetMouseButton(0) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndAttack(enemy.gameObject));
     }
     else if (Input.GetMouseButtonDown(1) && IsTargetInRange(enemy.gameObject))
     {
         abilities.AttemptSpecialAbility(0, enemy.gameObject);
     }
     else if (Input.GetMouseButtonDown(1) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndPowerAttack(enemy.gameObject));
     }
 }
コード例 #7
0
 private void ScanForAbilityKeyDown()
 {
     for (int i = 0; i < _abilities.Abilities.Length; i++)
     {
         if (Input.GetKeyDown(i.ToString()))
         {
             _abilities.AttemptSpecialAbility(i);
         }
     }
 }
コード例 #8
0
 private void ProcessEnemyInteraction(EnemyAI enemy)
 {
     if (Input.GetMouseButtonDown(0) && IsTargetInRange(enemy.gameObject))
     {
         currentTarget = enemy.gameObject;
         weaponSystem.Attack(enemy.gameObject);
     }
     else if (Input.GetMouseButtonDown(0) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndAttack(enemy));
     }
     else if (Input.GetMouseButtonDown(1) && IsTargetInRange(enemy.gameObject))
     {
         abilities.AttemptSpecialAbility(2, currentTarget);
     }
     else if (Input.GetMouseButtonDown(1) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndPowerAttack(enemy));
     }
 }
コード例 #9
0
        IEnumerator MoveAndAbility(EnemyAI target)
        {
            yield return(StartCoroutine(MoveToTarget(target)));

            specialAbilities.AttemptSpecialAbility(0, target.gameObject);
        }