Beispiel #1
0
 protected override void Attack()
 {
     Enemy[] enemies = EnemyInRangeChecker.GetAllEnemiesInRangeFromLocation(Targets[0].gameObject.transform.position, 1);
     foreach (var target in enemies)
     {
         target.enemyHealth.TakeDamage(damage);
     }
     Targets.Clear();
 }
Beispiel #2
0
    protected override bool CanAttack()
    {
        Enemy enemy = EnemyInRangeChecker.GetFirstEnemyInRange();

        if (enemy == null)
        {
            return(false);
        }
        Targets.Add(enemy);
        return(true);
    }
Beispiel #3
0
 protected override bool CanAttack()
 {
     Enemy[] enemies = EnemyInRangeChecker.GetallEnemiesInRange();
     if (enemies.Length <= 0)
     {
         return(false);
     }
     foreach (var e in enemies)
     {
         Targets.Add(e);
     }
     return(true);
 }
 private void Awake()
 {
     _rangeChecker = GetComponent <EnemyInRangeChecker>();
 }
 private void Awake()
 {
     _rangeChecker    = GetComponent <EnemyInRangeChecker>();
     _currentCooldown = _cooldown;
 }
Beispiel #6
0
 public Slash(EnemyInRangeChecker checker)
 {
     _rangeChecker = checker;
 }
 void Awake()
 {
     Targets             = new List <Enemy>();
     EnemyInRangeChecker = GetComponent <EnemyInRangeChecker>();
 }