public override void Shoot() { if (EnemyList.Contains(Target)) { StartCoroutine("LockOnAndShoot"); } else { Target = null; } }
public override void SearchForTarget() { foreach (GameObject t in EnemyList) { if (EnemyList.Contains(t)) { float Distance = Vector3.Distance(transform.position, t.transform.position); if (Distance <= Range && t != null) { Target = t; break; } } if (!GameManager.Instance.EnemiesAlive.Contains(t)) { Target = null; } } }