//Custom void OnKeyPress(int _key) { if (_key == 0 || _key >= abilities.GetNumberOfAbilities()) { return; } abilities.AttemptSpecialAbility(_key); }
private void ScanForAbilityKeyDown() { for (int keyIndex = 0; keyIndex < abilities.GetNumberOfAbilities(); keyIndex++) { if (Input.GetKeyDown(keyIndex.ToString())) { abilities.AttemptSpecialAbility(keyIndex); } } }
private void ScanForAbilityKeyDown() { for (int i = 0; i < abilities.GetNumberOfAbilities(); i++) { if (abilities.abilities[i] && Input.GetKeyDown(abilities.abilities[i].ButtonName)) { abilities.AttemptSpecialAbility(i); } } }
void ScanForAbilityKeyDown() { for (int key = 1; key < specialAbilities.getNumberOfAbilities(); key++) { if (Input.GetKeyDown(key.ToString())) { specialAbilities.AttemptSpecialAbility(key); currentAbilityIndex = key; } } }
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()); } }
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)); } }
private void ScanForAbilityKeyDown() { for (int i = 0; i < _abilities.Abilities.Length; i++) { if (Input.GetKeyDown(i.ToString())) { _abilities.AttemptSpecialAbility(i); } } }
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)); } }
IEnumerator MoveAndAbility(EnemyAI target) { yield return(StartCoroutine(MoveToTarget(target))); specialAbilities.AttemptSpecialAbility(0, target.gameObject); }