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.SpawnDirector Class Referencesealed

Drives spawn system intensity over time or via explicit steps. Applies values from an IntensityProfile to a bound RuntimeSpawner (population caps, spawn rates, etc.). More...

Inheritance diagram for MegaCrush.Spawner.SpawnDirector:

Public Member Functions

void Init (RuntimeSpawner spawner)
 Binds the director to a spawner. Called by RuntimeSpawner.Init.
 
void Begin ()
 Applies the starting step and, if configured, begins auto-advancing. Called by RuntimeSpawner.StartSpawners.
 
void Stop ()
 Stops any auto-advance coroutine. Manual step control remains available.
 
void StepUp (int delta=1)
 Increases the current step by delta (clamped to valid range).
 
void StepDown (int delta=1)
 Decreases the current step by delta (clamped to valid range).
 
void SetStep (int index)
 Sets the current step to index (clamped to valid range).
 

Properties

IntensityProfile Profile [get, set]
 The profile that defines intensity steps and advance mode.
 
int CurrentStep [get]
 The currently applied step index (0-based).
 
int MaxStep [get]
 Maximum valid step index (0-based), or 0 if the profile is empty.
 
int StepsCount [get]
 Number of steps defined by the profile, or 0 if none.
 

Events

Action< int > OnStepChanged
 Raised whenever the active step changes. Payload is the new step index.
 

Private Member Functions

IEnumerator AutoAdvance ()
 Automatically advances steps over time when the profile is configured for timed advance.
 
void ApplyStep (int idx)
 Applies a profile step and updates the bound spawner's tuning values.
 

Private Attributes

IntensityProfile profile
 
int startStep = 0
 
RuntimeSpawner _spawner
 
int _currentStep
 
Coroutine _autoCoro
 

Detailed Description

Drives spawn system intensity over time or via explicit steps. Applies values from an IntensityProfile to a bound RuntimeSpawner (population caps, spawn rates, etc.).

Member Function Documentation

◆ ApplyStep()

void MegaCrush.Spawner.SpawnDirector.ApplyStep ( int idx)
private

Applies a profile step and updates the bound spawner's tuning values.

Parameters
idxStep index to apply (assumed clamped).

◆ AutoAdvance()

IEnumerator MegaCrush.Spawner.SpawnDirector.AutoAdvance ( )
private

Automatically advances steps over time when the profile is configured for timed advance.

◆ Begin()

void MegaCrush.Spawner.SpawnDirector.Begin ( )

Applies the starting step and, if configured, begins auto-advancing. Called by RuntimeSpawner.StartSpawners.

◆ Init()

void MegaCrush.Spawner.SpawnDirector.Init ( RuntimeSpawner spawner)

Binds the director to a spawner. Called by RuntimeSpawner.Init.

Parameters
spawnerSpawner to control.

◆ SetStep()

void MegaCrush.Spawner.SpawnDirector.SetStep ( int index)

Sets the current step to index (clamped to valid range).

◆ StepDown()

void MegaCrush.Spawner.SpawnDirector.StepDown ( int delta = 1)

Decreases the current step by delta (clamped to valid range).

◆ StepUp()

void MegaCrush.Spawner.SpawnDirector.StepUp ( int delta = 1)

Increases the current step by delta (clamped to valid range).

◆ Stop()

void MegaCrush.Spawner.SpawnDirector.Stop ( )

Stops any auto-advance coroutine. Manual step control remains available.

Member Data Documentation

◆ _autoCoro

Coroutine MegaCrush.Spawner.SpawnDirector._autoCoro
private

◆ _currentStep

int MegaCrush.Spawner.SpawnDirector._currentStep
private

◆ _spawner

RuntimeSpawner MegaCrush.Spawner.SpawnDirector._spawner
private

◆ profile

IntensityProfile MegaCrush.Spawner.SpawnDirector.profile
private

◆ startStep

int MegaCrush.Spawner.SpawnDirector.startStep = 0
private

Property Documentation

◆ CurrentStep

int MegaCrush.Spawner.SpawnDirector.CurrentStep
get

The currently applied step index (0-based).

◆ MaxStep

int MegaCrush.Spawner.SpawnDirector.MaxStep
get

Maximum valid step index (0-based), or 0 if the profile is empty.

◆ Profile

IntensityProfile MegaCrush.Spawner.SpawnDirector.Profile
getset

The profile that defines intensity steps and advance mode.

◆ StepsCount

int MegaCrush.Spawner.SpawnDirector.StepsCount
get

Number of steps defined by the profile, or 0 if none.

Event Documentation

◆ OnStepChanged

Action<int> MegaCrush.Spawner.SpawnDirector.OnStepChanged

Raised whenever the active step changes. Payload is the new step index.


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