Beispiel #1
0
 public override void Shoot()
 {
     if (EnemyList.Contains(Target))
     {
         StartCoroutine("LockOnAndShoot");
     }
     else
     {
         Target = null;
     }
 }
Beispiel #2
0
    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;
            }
        }
    }