Runtime Spawner 1.2.5
Generic Runtime spawn and instance pooling system for spawning random AI agents around a map. Works with ANY AI system easily.
Loading...
Searching...
No Matches
MegaCrush.Spawner.RegionSpawnLoop Class Referencesealed

Periodic loop that manages spawning in active LocalAreaSpawner regions. Ensures each active region maintains its local population between its min/max bounds. More...

Public Member Functions

 RegionSpawnLoop (RuntimeSpawner owner, ISpawnExecutor exec, PopulationTracker pop)
 Constructs a region spawn loop bound to a spawner.
 
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 MinObjectCount/MaxObjectCount, while respecting the global maxPopulation cap. Entries that enable group spawning will spawn additional members parented to the initial object.
 

Private Attributes

readonly RuntimeSpawner _owner
 
readonly ISpawnExecutor _exec
 
readonly PopulationTracker _pop
 

Detailed Description

Periodic loop that manages spawning in active LocalAreaSpawner regions. Ensures each active region maintains its local population between its min/max bounds.

Constructor & Destructor Documentation

◆ RegionSpawnLoop()

MegaCrush.Spawner.RegionSpawnLoop.RegionSpawnLoop ( RuntimeSpawner owner,
ISpawnExecutor exec,
PopulationTracker pop )

Constructs a region spawn loop bound to a spawner.

Parameters
ownerOwning RuntimeSpawner providing context and settings.
execExecutor responsible for performing spawns.
popPopulation tracker used for caps and bookkeeping.

Member Function Documentation

◆ Run()

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 MinObjectCount/MaxObjectCount, while respecting the global maxPopulation cap. Entries that enable group spawning will spawn additional members parented to the initial object.

Parameters
activeRegionsList of regions currently active (player inside).
maxPopulationHard cap across all alive spawned objects.

Member Data Documentation

◆ _exec

readonly ISpawnExecutor MegaCrush.Spawner.RegionSpawnLoop._exec
private

◆ _owner

readonly RuntimeSpawner MegaCrush.Spawner.RegionSpawnLoop._owner
private

◆ _pop

readonly PopulationTracker MegaCrush.Spawner.RegionSpawnLoop._pop
private

The documentation for this class was generated from the following file: