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

Protected Member Functions

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

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.

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: