|
Runtime Spawner 1.5.1
Generic Runtime spawn and instance pooling system for spawning random AI agents around a map. Works with ANY AI system easily.
|
Periodic loop that manages spawning in active LocalAreaSpawner regions. Ensures each active region maintains its local population between its min/max bounds, while respecting the global max population and per-entry caps. More...
Public Member Functions | |
| RegionSpawnLoop (RuntimeSpawner owner, ISpawnExecutor exec, PopulationTracker pop) | |
| IEnumerator | Run (List< LocalAreaSpawner > activeRegions, int maxPopulation) |
| Coroutine that runs continuously while RuntimeSpawner.UseRegionSpawners is enabled. For each active region, spawns up to the region’s configured Min/Max (with DensityMult/Override), while respecting the global maxPopulation cap and per-entry maxPopulation. | |
Private Member Functions | |
| void | BuildEligibleEntries (List< SpawnEntry > entries) |
| Filters a region's entries into _eligibleEntries based on per-entry maxPopulation. | |
Private Attributes | |
| readonly RuntimeSpawner | _owner |
| readonly ISpawnExecutor | _exec |
| readonly PopulationTracker | _pop |
| readonly List< SpawnEntry > | _eligibleEntries = new(64) |
Periodic loop that manages spawning in active LocalAreaSpawner regions. Ensures each active region maintains its local population between its min/max bounds, while respecting the global max population and per-entry caps.
| MegaCrush.Spawner.RegionSpawnLoop.RegionSpawnLoop | ( | RuntimeSpawner | owner, |
| ISpawnExecutor | exec, | ||
| PopulationTracker | pop ) |
|
private |
Filters a region's entries into _eligibleEntries based on per-entry maxPopulation.
| IEnumerator MegaCrush.Spawner.RegionSpawnLoop.Run | ( | List< LocalAreaSpawner > | activeRegions, |
| int | maxPopulation ) |
Coroutine that runs continuously while RuntimeSpawner.UseRegionSpawners is enabled. For each active region, spawns up to the region’s configured Min/Max (with DensityMult/Override), while respecting the global maxPopulation cap and per-entry maxPopulation.
| activeRegions | List of regions currently active (player inside). |
| maxPopulation | Hard cap across all alive spawned objects. |
|
private |
|
private |
|
private |
|
private |