Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.Spawner Class Reference

Spawns enemies. More...

Inheritance diagram for PlatformerPro.Spawner:
PlatformerPro.Pool PlatformerPro.EnemySpawner

Public Member Functions

virtual void SpawnNow ()
 If this is not an auto spawner start spawning. More...
 
- Public Member Functions inherited from PlatformerPro.Pool
void Start ()
 Unity Start hook. More...
 
virtual GameObject GetInstance ()
 Gets an instance form the pool, or null if no instances available. More...
 

Public Attributes

bool autoSpawn = true
 If true we spawn automatically. If false we wait until something calls us. More...
 
int spawnAmount
 How many objects to spawn, use -1 for infinite. More...
 
float spawnRate
 How fast should we spawn. More...
 
bool delayOnFirstInstance
 If true the first instance will be delayed by the spawn rate, else it will spawn instantly. More...
 
- Public Attributes inherited from PlatformerPro.Pool
List< GameObject > pooledObjects
 The pooled objects. You can assign the pool here, this can be useful if you don't want all objects to be the same. More...
 
GameObject poolPrefab
 Prefab to use to create new pool objects. More...
 
int startingSize
 Starting size of pool. More...
 
bool createMoreIfExhausted
 Should we create more objects if pool is exhausted or should we throw an error. More...
 

Protected Member Functions

override void Init ()
 Initialise pool. More...
 
virtual IEnumerator Spawn ()
 Coroutine that spawns enemies. More...
 
virtual void DoSpawn ()
 Do the spawning. More...
 
- Protected Member Functions inherited from PlatformerPro.Pool
virtual void PopulatePool ()
 Initialise the pool. More...
 
virtual GameObject CreateInstance ()
 Creates a new instance. More...
 
virtual void Reset (GameObject instance)
 Reset the specified instance. Specific implementations should override this. More...
 

Protected Attributes

int spawnsRemaining
 How many spwns remain. More...
 
- Protected Attributes inherited from PlatformerPro.Pool
int currentPosition
 Current position in pool. More...
 

Detailed Description

Spawns enemies.

Member Function Documentation

◆ DoSpawn()

virtual void PlatformerPro.Spawner.DoSpawn ( )
protectedvirtual

Do the spawning.

◆ Init()

override void PlatformerPro.Spawner.Init ( )
protectedvirtual

Initialise pool.

Reimplemented from PlatformerPro.Pool.

◆ Spawn()

virtual IEnumerator PlatformerPro.Spawner.Spawn ( )
protectedvirtual

Coroutine that spawns enemies.

Reimplemented in PlatformerPro.EnemySpawner.

◆ SpawnNow()

virtual void PlatformerPro.Spawner.SpawnNow ( )
virtual

If this is not an auto spawner start spawning.

Member Data Documentation

◆ autoSpawn

bool PlatformerPro.Spawner.autoSpawn = true

If true we spawn automatically. If false we wait until something calls us.

◆ delayOnFirstInstance

bool PlatformerPro.Spawner.delayOnFirstInstance

If true the first instance will be delayed by the spawn rate, else it will spawn instantly.

◆ spawnAmount

int PlatformerPro.Spawner.spawnAmount

How many objects to spawn, use -1 for infinite.

◆ spawnRate

float PlatformerPro.Spawner.spawnRate

How fast should we spawn.

◆ spawnsRemaining

int PlatformerPro.Spawner.spawnsRemaining
protected

How many spwns remain.


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