Wave Managing
Setting up the component
Create an empty game object in the scene. You can name it "Wave Manager", for example.
Add the component WaveManager to it.
When you add it, you will face with this inspector:
We will cover each section down below.
Mandatory references
All this settings must be filled in order to make component work.
CurrentGraph
SpawnerGraph you want to spawn enemies from
SpawnPointsIDManager
SpawnPointsIDManager in the scene. See Managing Spawnpoints for more information.
EnemyFactory
Enemy Factory with all the prefabs of your enemies. See Setting up project for more information
Optional Parameters
ParentToSpawnEnemies
Give a transform, and all spawned enemies will be child of the given transform.
It's highly recommended, to not populate all Unity hierarchy
Make sure ParentToSpawnEnemies is in world position (0,0,0). It's not necessary, but highly recommended.
Settings
StartSpawningOnAwake
If true, it will start spawning on starting scene. If false, you will need to call StartRound function in order to initialize it.
StartNewRoundAutomatically
If true, new round will start after Delay Between Rounds time.
If false, you must call StartRound method again to start spawning
DelayBetweenRounds
Delay in seconds between last round and new round. Only works if StartNewRoundAutomatically is active.
Events
UnityEvent
OnRoundFinished
When current round of the graph has finished
UnityEvent
OnAllRoundsFinished
When all rounds of the graph have been spawned
UnityEvent<GameObject>
OnEnemySpawn
Raised when spawns enemy. It has the enemy GameObject reference
Debug
DisableDebugSettings
This disables any debug feature from this list. It actually does nothing, but it will
StarterRound
Sets starting round of spawning
Details
In your game, you should set up a graph for each map, but you can also set multiple graphs. If round is not active, you can change it anytime you want.
Recommended structure would be:
Having a graph for each map.
One SpawnPo
Last updated