Runtime Spawner 1.0.0
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

A very simple trigger system for the Wave Spawner. More...

Inheritance diagram for MegaCrush.Spawner.WaveTrigger:

Public Member Functions

void ResetTrigger ()
 Manually reset this trigger? Will reactivate if ReactivateTrigger is true.
 
void AddSpawnpoint ()
 
void ShowHide (bool showHide)
 Editor only, draw the volume in the scene view.
 

Properties

BoxCollider TriggerZone [get, set]
 Trigger zone for this trigger.
 
int ActiveWave [get, set]
 The current active wave that we are spawning.
 
bool IsActivated [get, set]
 Have we been activated? start spawning!
 
WaveSpawner WaveSpawner [get, set]
 The WaveSpawner holds the wave config.
 
List< WaveSpawnPointWaveSpawnPoints [get]
 When activated, units will spawn at random spawnpoints.
 

Events

static Action< WaveTriggeronWaveTriggerActivated
 Runtime Spawner listens to this to activate the spawning.
 
static Action< WaveTriggeronWaveTriggerReset
 

Private Member Functions

void OnEnable ()
 
void Start ()
 
void OnTriggerEnter (Collider other)
 This trigger was entered, check if we need to activate.
 
IEnumerator TimeToReset ()
 Internal coroutine timer to reset the trigger.
 
RuntimeSpawnerSettings GetSettings ()
 
void OnDrawGizmos ()
 Draw our editor gizmos.
 

Private Attributes

List< WaveSpawnPointwaveSpawnPoints = new()
 When activated, units will spawn at random spawnpoints.
 
WaveSpawner waveSpawner
 the wave spawner used by this trigger
 
bool reactivateTrigger = false
 Does this trigger reactivate once complete?
 
float reactivateTime = 10f
 How long before we reactivate?
 
bool startAutomatically = false
 Does this spawner start automatically?
 
string playerTag = "Player"
 Our trigger is activated by objects with this tag.
 
BoxCollider triggerZone
 The trigger area for this trigger.
 
int activeWave = 0
 The active wave.
 
bool isActivated = false
 Has this trigger been activated.
 
bool showHideTrigger = false
 internal / editor only if the gizmos are visible
 
RuntimeSpawnerSettings settings
 

Detailed Description

A very simple trigger system for the Wave Spawner.

Member Function Documentation

◆ AddSpawnpoint()

void MegaCrush.Spawner.WaveTrigger.AddSpawnpoint ( )

◆ GetSettings()

RuntimeSpawnerSettings MegaCrush.Spawner.WaveTrigger.GetSettings ( )
private

◆ OnDrawGizmos()

void MegaCrush.Spawner.WaveTrigger.OnDrawGizmos ( )
private

Draw our editor gizmos.

◆ OnEnable()

void MegaCrush.Spawner.WaveTrigger.OnEnable ( )
private

◆ OnTriggerEnter()

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

This trigger was entered, check if we need to activate.

Parameters
other

◆ ResetTrigger()

void MegaCrush.Spawner.WaveTrigger.ResetTrigger ( )

Manually reset this trigger? Will reactivate if ReactivateTrigger is true.

◆ ShowHide()

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

Editor only, draw the volume in the scene view.

Parameters
showHideTrue to show / false to hide

◆ Start()

void MegaCrush.Spawner.WaveTrigger.Start ( )
private

◆ TimeToReset()

IEnumerator MegaCrush.Spawner.WaveTrigger.TimeToReset ( )
private

Internal coroutine timer to reset the trigger.

Returns

Member Data Documentation

◆ activeWave

int MegaCrush.Spawner.WaveTrigger.activeWave = 0
private

The active wave.

◆ isActivated

bool MegaCrush.Spawner.WaveTrigger.isActivated = false
private

Has this trigger been activated.

◆ playerTag

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

Our trigger is activated by objects with this tag.

◆ reactivateTime

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

How long before we reactivate?

◆ reactivateTrigger

bool MegaCrush.Spawner.WaveTrigger.reactivateTrigger = false
private

Does this trigger reactivate once complete?

◆ settings

RuntimeSpawnerSettings MegaCrush.Spawner.WaveTrigger.settings
private

◆ showHideTrigger

bool MegaCrush.Spawner.WaveTrigger.showHideTrigger = false
private

internal / editor only if the gizmos are visible

◆ startAutomatically

bool MegaCrush.Spawner.WaveTrigger.startAutomatically = false
private

Does this spawner start automatically?

◆ triggerZone

BoxCollider MegaCrush.Spawner.WaveTrigger.triggerZone
private

The trigger area for this trigger.

◆ waveSpawner

WaveSpawner MegaCrush.Spawner.WaveTrigger.waveSpawner
private

the wave spawner used by this trigger

◆ waveSpawnPoints

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

When activated, units will spawn at random spawnpoints.

Property Documentation

◆ ActiveWave

int MegaCrush.Spawner.WaveTrigger.ActiveWave
getset

The current active wave that we are spawning.

◆ IsActivated

bool MegaCrush.Spawner.WaveTrigger.IsActivated
getset

Have we been activated? start spawning!

◆ TriggerZone

BoxCollider MegaCrush.Spawner.WaveTrigger.TriggerZone
getset

Trigger zone for this trigger.

◆ WaveSpawner

WaveSpawner MegaCrush.Spawner.WaveTrigger.WaveSpawner
getset

The WaveSpawner holds the wave config.

◆ WaveSpawnPoints

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

When activated, units will spawn at random spawnpoints.

Event Documentation

◆ onWaveTriggerActivated

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

Runtime Spawner listens to this to activate the spawning.

◆ onWaveTriggerReset

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

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