Beispiel #1
0
 // Update is called once per frame
 void Remove()
 {
     GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");
     foreach (GameObject enemy in enemies)
     {
         Vector3 difference = transform.position - enemy.transform.position;
         if (difference.sqrMagnitude <= radius)
         {
             Destroy(enemy);
             performanceMonitor.Decrease();
             lineSpawner.SpawnBetweenThenDestroy(transform.position, enemy.transform.position, laserLifetime);
             return;
         }
     }
 }