TopDown Engine  v3.6
MoreMountains.TopDownEngine.TimedSpawner Class Reference

A class meant to be used in conjunction with an object pool (simple or multiple) to spawn objects regularly, at a frequency randomly chosen between the min and max values set in its inspector More...

Inheritance diagram for MoreMountains.TopDownEngine.TimedSpawner:
MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Member Functions

virtual void ToggleSpawn ()
 Toggles spawn on and off More...
 
virtual void TurnSpawnOff ()
 Turns spawning off More...
 
virtual void TurnSpawnOn ()
 Turns spawning on More...
 

Public Attributes

bool CanSpawn = true
 whether or not this spawner can spawn More...
 
float MinFrequency = 1f
 the minimum frequency possible, in seconds More...
 
float MaxFrequency = 1f
 the maximum frequency possible, in seconds More...
 
bool CanSpawnButton
 a test button to spawn an object More...
 

Protected Member Functions

virtual void Start ()
 On Start we initialize our spawner More...
 
virtual void Initialization ()
 Grabs the associated object pooler if there's one, and initalizes the frequency More...
 
virtual void Update ()
 Every frame we check whether or not we should spawn something More...
 
virtual void Spawn ()
 Spawns an object out of the pool if there's one available. If it's an object with Health, revives it too. More...
 
virtual void DetermineNextFrequency ()
 Determines the next frequency by randomizing a value between the two specified in the inspector. More...
 

Protected Attributes

float _lastSpawnTimestamp = 0f
 
float _nextFrequency = 0f
 

Properties

virtual MMObjectPooler ObjectPooler [get, set]
 the object pooler associated to this spawner More...
 

Detailed Description

A class meant to be used in conjunction with an object pool (simple or multiple) to spawn objects regularly, at a frequency randomly chosen between the min and max values set in its inspector

Member Function Documentation

◆ DetermineNextFrequency()

virtual void MoreMountains.TopDownEngine.TimedSpawner.DetermineNextFrequency ( )
protectedvirtual

Determines the next frequency by randomizing a value between the two specified in the inspector.

◆ Initialization()

virtual void MoreMountains.TopDownEngine.TimedSpawner.Initialization ( )
protectedvirtual

Grabs the associated object pooler if there's one, and initalizes the frequency

◆ Spawn()

virtual void MoreMountains.TopDownEngine.TimedSpawner.Spawn ( )
protectedvirtual

Spawns an object out of the pool if there's one available. If it's an object with Health, revives it too.

◆ Start()

virtual void MoreMountains.TopDownEngine.TimedSpawner.Start ( )
protectedvirtual

On Start we initialize our spawner

◆ ToggleSpawn()

virtual void MoreMountains.TopDownEngine.TimedSpawner.ToggleSpawn ( )
virtual

Toggles spawn on and off

◆ TurnSpawnOff()

virtual void MoreMountains.TopDownEngine.TimedSpawner.TurnSpawnOff ( )
virtual

Turns spawning off

◆ TurnSpawnOn()

virtual void MoreMountains.TopDownEngine.TimedSpawner.TurnSpawnOn ( )
virtual

Turns spawning on

◆ Update()

virtual void MoreMountains.TopDownEngine.TimedSpawner.Update ( )
protectedvirtual

Every frame we check whether or not we should spawn something

Member Data Documentation

◆ _lastSpawnTimestamp

float MoreMountains.TopDownEngine.TimedSpawner._lastSpawnTimestamp = 0f
protected

◆ _nextFrequency

float MoreMountains.TopDownEngine.TimedSpawner._nextFrequency = 0f
protected

◆ CanSpawn

bool MoreMountains.TopDownEngine.TimedSpawner.CanSpawn = true

whether or not this spawner can spawn

◆ CanSpawnButton

bool MoreMountains.TopDownEngine.TimedSpawner.CanSpawnButton

a test button to spawn an object

◆ MaxFrequency

float MoreMountains.TopDownEngine.TimedSpawner.MaxFrequency = 1f

the maximum frequency possible, in seconds

◆ MinFrequency

float MoreMountains.TopDownEngine.TimedSpawner.MinFrequency = 1f

the minimum frequency possible, in seconds

Property Documentation

◆ ObjectPooler

virtual MMObjectPooler MoreMountains.TopDownEngine.TimedSpawner.ObjectPooler
getset

the object pooler associated to this spawner


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