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.WaveTrigger Class Reference

Simple trigger volume that activates a WaveSpawner sequence when the player enters. Supports optional reactivation after a cooldown and editor helpers for authoring spawn points. More...

Inheritance diagram for MegaCrush.Spawner.WaveTrigger:

Public Member Functions

void ResetTrigger ()
 Manually initiates a reset cycle (useful from editor buttons or scripts). If reactivateTrigger is true, the trigger becomes eligible again after the cooldown.
 
void AddSpawnpoint ()
 Creates a new child WaveSpawnPoint and selects it in the hierarchy.
 
void ShowHide (bool showHide)
 Editor-only: toggles whether the trigger volume gizmo is drawn.
 

Properties

BoxCollider TriggerZone [get, set]
 The trigger volume that detects activation (auto-assigned on enable).
 
int ActiveWave [get, set]
 The current wave index being spawned (0-based).
 
bool IsActivated [get, set]
 Whether this trigger is currently active (sequence running or ready).
 
WaveSpawner WaveSpawner [get, set]
 The wave table configuration used when this trigger activates.
 
List< WaveSpawnPointWaveSpawnPoints [get]
 Optional spawn anchors used when this trigger activates (randomly chosen).
 

Events

static Action< WaveTriggeronWaveTriggerActivated
 Fired when this trigger activates. RuntimeSpawner listens to begin spawning.
 
static Action< WaveTriggeronWaveTriggerReset
 Fired when this trigger resets after a cooldown (if reactivation is enabled).
 

Private Member Functions

void OnEnable ()
 
void OnDisable ()
 
void Start ()
 
void Init (float _)
 
IEnumerator ActivateWhenReady ()
 
void OnTriggerEnter (Collider other)
 Activation when a qualifying object enters the trigger volume.
 
IEnumerator TimeToReset ()
 Handles the reactivation cooldown (if enabled).
 
RuntimeSpawnerSettings GetSettings ()
 
void OnDrawGizmos ()
 Draws the trigger volume in the Scene view, with a distinct color when active.
 

Private Attributes

List< WaveSpawnPointwaveSpawnPoints = new()
 
WaveSpawner waveSpawner
 
bool reactivateTrigger = false
 
float reactivateTime = 10f
 
bool startAutomatically = false
 
string playerTag = "Player"
 
BoxCollider triggerZone
 
int activeWave = 0
 
bool isActivated = false
 
bool initialized = false
 
bool showHideTrigger = false
 
RuntimeSpawner spawner
 
RuntimeSpawnerSettings settings
 

Detailed Description

Simple trigger volume that activates a WaveSpawner sequence when the player enters. Supports optional reactivation after a cooldown and editor helpers for authoring spawn points.

Member Function Documentation

◆ ActivateWhenReady()

IEnumerator MegaCrush.Spawner.WaveTrigger.ActivateWhenReady ( )
private

◆ AddSpawnpoint()

void MegaCrush.Spawner.WaveTrigger.AddSpawnpoint ( )

Creates a new child WaveSpawnPoint and selects it in the hierarchy.

◆ GetSettings()

RuntimeSpawnerSettings MegaCrush.Spawner.WaveTrigger.GetSettings ( )
private

◆ Init()

void MegaCrush.Spawner.WaveTrigger.Init ( float _)
private

◆ OnDisable()

void MegaCrush.Spawner.WaveTrigger.OnDisable ( )
private

◆ OnDrawGizmos()

void MegaCrush.Spawner.WaveTrigger.OnDrawGizmos ( )
private

Draws the trigger volume in the Scene view, with a distinct color when active.

◆ OnEnable()

void MegaCrush.Spawner.WaveTrigger.OnEnable ( )
private

◆ OnTriggerEnter()

void MegaCrush.Spawner.WaveTrigger.OnTriggerEnter ( Collider other)
private

Activation when a qualifying object enters the trigger volume.

◆ ResetTrigger()

void MegaCrush.Spawner.WaveTrigger.ResetTrigger ( )

Manually initiates a reset cycle (useful from editor buttons or scripts). If reactivateTrigger is true, the trigger becomes eligible again after the cooldown.

◆ ShowHide()

void MegaCrush.Spawner.WaveTrigger.ShowHide ( bool showHide)

Editor-only: toggles whether the trigger volume gizmo is drawn.

Parameters
showHideTrue to show; false to hide.

◆ Start()

void MegaCrush.Spawner.WaveTrigger.Start ( )
private

◆ TimeToReset()

IEnumerator MegaCrush.Spawner.WaveTrigger.TimeToReset ( )
private

Handles the reactivation cooldown (if enabled).

Member Data Documentation

◆ activeWave

int MegaCrush.Spawner.WaveTrigger.activeWave = 0
private

◆ initialized

bool MegaCrush.Spawner.WaveTrigger.initialized = false
private

◆ isActivated

bool MegaCrush.Spawner.WaveTrigger.isActivated = false
private

◆ playerTag

string MegaCrush.Spawner.WaveTrigger.playerTag = "Player"
private

◆ reactivateTime

float MegaCrush.Spawner.WaveTrigger.reactivateTime = 10f
private

◆ reactivateTrigger

bool MegaCrush.Spawner.WaveTrigger.reactivateTrigger = false
private

◆ settings

RuntimeSpawnerSettings MegaCrush.Spawner.WaveTrigger.settings
private

◆ showHideTrigger

bool MegaCrush.Spawner.WaveTrigger.showHideTrigger = false
private

◆ spawner

RuntimeSpawner MegaCrush.Spawner.WaveTrigger.spawner
private

◆ startAutomatically

bool MegaCrush.Spawner.WaveTrigger.startAutomatically = false
private

◆ triggerZone

BoxCollider MegaCrush.Spawner.WaveTrigger.triggerZone
private

◆ waveSpawner

WaveSpawner MegaCrush.Spawner.WaveTrigger.waveSpawner
private

◆ waveSpawnPoints

List<WaveSpawnPoint> MegaCrush.Spawner.WaveTrigger.waveSpawnPoints = new()
private

Property Documentation

◆ ActiveWave

int MegaCrush.Spawner.WaveTrigger.ActiveWave
getset

The current wave index being spawned (0-based).

◆ IsActivated

bool MegaCrush.Spawner.WaveTrigger.IsActivated
getset

Whether this trigger is currently active (sequence running or ready).

◆ TriggerZone

BoxCollider MegaCrush.Spawner.WaveTrigger.TriggerZone
getset

The trigger volume that detects activation (auto-assigned on enable).

◆ WaveSpawner

WaveSpawner MegaCrush.Spawner.WaveTrigger.WaveSpawner
getset

The wave table configuration used when this trigger activates.

◆ WaveSpawnPoints

List<WaveSpawnPoint> MegaCrush.Spawner.WaveTrigger.WaveSpawnPoints
get

Optional spawn anchors used when this trigger activates (randomly chosen).

Event Documentation

◆ onWaveTriggerActivated

Action<WaveTrigger> MegaCrush.Spawner.WaveTrigger.onWaveTriggerActivated
static

Fired when this trigger activates. RuntimeSpawner listens to begin spawning.

◆ onWaveTriggerReset

Action<WaveTrigger> MegaCrush.Spawner.WaveTrigger.onWaveTriggerReset
static

Fired when this trigger resets after a cooldown (if reactivation is enabled).


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