Infinite Runner Engine v1.9
Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.InfiniteRunnerEngine.TimedSpawner Class Reference

This spawns an object at random intervals within the specified bounds. More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.TimedSpawner:
MoreMountains.InfiniteRunnerEngine.Spawner

Public Attributes

float MinSpawnTime = 0.5f
 the minimum interval (in seconds) between 2 spawns More...
 
float MaxSpawnTime = 2f
 the maximum interval (in seconds) between 2 spawns More...
 
Vector3 MinPosition
 the minimum position of the object More...
 
Vector3 MaxPosition
 the maximum position of the object More...
 
- Public Attributes inherited from MoreMountains.InfiniteRunnerEngine.Spawner
Vector3 MinimumSize =new Vector3(1,1,1)
 the minimum size of a spawned object More...
 
Vector3 MaximumSize =new Vector3(1,1,1)
 the maximum size of a spawned object More...
 
bool PreserveRatio =false
 if set to true, the random size will preserve the original's aspect ratio More...
 
Vector3 MinimumRotation
 the minimum size of a spawned object More...
 
Vector3 MaximumRotation
 the maximum size of a spawned object More...
 
bool Spawning =true
 if true, the spawner can spawn, if not, it won't spawn More...
 
bool OnlySpawnWhileGameInProgress = true
 if true, only spawn objects while the game is in progress More...
 
float InitialDelay =0f
 Initial delay before the first spawn, in seconds. More...
 

Protected Member Functions

virtual void Start ()
 On start, we store the objectPooler component and schedule the first spawn More...
 
virtual void Update ()
 On update, we check if we should spawn or not More...
 
virtual void TimeSpawn ()
 Spawns and positions an object, and schedules the next spawn More...
 
virtual float RandomDuration ()
 Returns a new random duration based on min and max spawn times More...
 
- Protected Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Spawner
virtual void Awake ()
 On awake, we get the objectPooler component More...
 

Protected Attributes

float _timeUntilNextSpawn = 0f
 
float _timeSinceLastSpawn = 0f
 
- Protected Attributes inherited from MoreMountains.InfiniteRunnerEngine.Spawner
MMObjectPooler _objectPooler
 
float _startTime
 

Additional Inherited Members

- Public Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Spawner
virtual GameObject Spawn (Vector3 spawnPosition, bool triggerObjectActivation=true)
 Spawns a new object and positions/resizes it More...
 

Detailed Description

This spawns an object at random intervals within the specified bounds.

Member Function Documentation

◆ RandomDuration()

virtual float MoreMountains.InfiniteRunnerEngine.TimedSpawner.RandomDuration ( )
protectedvirtual

Returns a new random duration based on min and max spawn times

Returns
The duration.

◆ Start()

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

On start, we store the objectPooler component and schedule the first spawn

◆ TimeSpawn()

virtual void MoreMountains.InfiniteRunnerEngine.TimedSpawner.TimeSpawn ( )
protectedvirtual

Spawns and positions an object, and schedules the next spawn

◆ Update()

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

On update, we check if we should spawn or not

Member Data Documentation

◆ _timeSinceLastSpawn

float MoreMountains.InfiniteRunnerEngine.TimedSpawner._timeSinceLastSpawn = 0f
protected

◆ _timeUntilNextSpawn

float MoreMountains.InfiniteRunnerEngine.TimedSpawner._timeUntilNextSpawn = 0f
protected

◆ MaxPosition

Vector3 MoreMountains.InfiniteRunnerEngine.TimedSpawner.MaxPosition

the maximum position of the object

◆ MaxSpawnTime

float MoreMountains.InfiniteRunnerEngine.TimedSpawner.MaxSpawnTime = 2f

the maximum interval (in seconds) between 2 spawns

◆ MinPosition

Vector3 MoreMountains.InfiniteRunnerEngine.TimedSpawner.MinPosition

the minimum position of the object

◆ MinSpawnTime

float MoreMountains.InfiniteRunnerEngine.TimedSpawner.MinSpawnTime = 0.5f

the minimum interval (in seconds) between 2 spawns


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