diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 5860260..d147a6d 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -3729,7 +3729,10 @@ MonoBehaviour: initialSpawnDelay: 5 SpawnCenter: {fileID: 5796191506433166635} timer: 0 - enemyList: [] + enemyList: + - prefabs: + - {fileID: 7065654593080984807, guid: cfacc720818aabb4e9217dd1ae770886, type: 3} + Difficulty: 0 --- !u!1001 &4158834148864819266 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Enemy/EnemySpawner.cs b/Assets/Scripts/Enemy/EnemySpawner.cs index 87a192a..97a8527 100644 --- a/Assets/Scripts/Enemy/EnemySpawner.cs +++ b/Assets/Scripts/Enemy/EnemySpawner.cs @@ -61,7 +61,7 @@ public class EnemySpawner : NetworkBehaviour timer = WaveTime - initialSpawnDelay; - if (!IsClient) // If server then start spawning + if (IsServer || IsHost) // If server then start spawning StartSpawning(); } @@ -104,6 +104,7 @@ public class EnemySpawner : NetworkBehaviour { GameObject enemy = Instantiate(decendingList[i].prefabs[UnityEngine.Random.Range(0, decendingList[i].prefabs.Length)], GetRandomPointOnCircle(SpawnRadius), Quaternion.identity, SpawnedEnenmyHolder.transform); difficulty -= decendingList[i].Difficulty; + enemy.GetComponent().Spawn(); enemy.GetComponent().targets = players.Select(x=>x.transform).ToArray(); }