Fixed enemy spam spawning if single player
This commit is contained in:
parent
c2928c82d5
commit
9017315bfe
|
@ -135,7 +135,10 @@ public class EnemySpawner : NetworkBehaviour
|
|||
GameObject enemy = Instantiate(enemyPrefab, GetRandomPointOnCircle(SpawnRadius), Quaternion.identity, SpawnedEnenmyHolder.transform);
|
||||
enemy.GetComponent<NetworkObject>().Spawn();
|
||||
|
||||
if (players != null)
|
||||
enemy.GetComponent<EnemyPathFinding>().targets = players.Select(x => x.transform).ToArray();
|
||||
else
|
||||
enemy.GetComponent<EnemyPathFinding>().targets = new Transform[] { new GameObject("DummyTarget").transform};
|
||||
}
|
||||
|
||||
// Centrum is SpawnCenter
|
||||
|
|
Loading…
Reference in New Issue