Periodic loop that maintains global population between configured bounds. Chooses random SpawnEntry items from the global list and spawns them via the owner’s executor, optionally spawning groups.
More...
|
| GlobalSpawnLoop (RuntimeSpawner owner, ISpawnExecutor exec, PopulationTracker pop) |
| Constructs the global spawn loop.
|
|
IEnumerator | Run (List< SpawnEntry > globalSpawners, int minCount, int maxCount, int maxPopulation) |
| Coroutine that maintains global population: if below maxPopulation , spawns a random number of entries between minCount and maxCount (adjusted by current population). Entries that enable group spawning will spawn additional members parented to the first. The loop ticks according to RuntimeSpawner.GetGlobalTickSeconds.
|
|
Periodic loop that maintains global population between configured bounds. Chooses random SpawnEntry items from the global list and spawns them via the owner’s executor, optionally spawning groups.
◆ GlobalSpawnLoop()
Constructs the global spawn loop.
- Parameters
-
owner | Owning RuntimeSpawner providing context and settings. |
exec | Executor responsible for performing spawns. |
pop | Population tracker used for caps and bookkeeping. |
◆ Run()
IEnumerator MegaCrush.Spawner.GlobalSpawnLoop.Run |
( |
List< SpawnEntry > | globalSpawners, |
|
|
int | minCount, |
|
|
int | maxCount, |
|
|
int | maxPopulation ) |
Coroutine that maintains global population: if below maxPopulation , spawns a random number of entries between minCount and maxCount (adjusted by current population). Entries that enable group spawning will spawn additional members parented to the first. The loop ticks according to RuntimeSpawner.GetGlobalTickSeconds.
- Parameters
-
globalSpawners | Pool of global spawn entries to choose from. |
minCount | Lower bound on desired spawns per tick. |
maxCount | Upper bound on desired spawns per tick. |
maxPopulation | Hard cap across all alive spawned objects. |
◆ _exec
◆ _owner
◆ _pop
The documentation for this class was generated from the following file:
- D:/projects/Asset Store Packages/com.pixelwizards.runtimespawner/Code/Runtime/Internals/SpawnLoops/GlobalSpawnLoop.cs