Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.EnemySpawner Class Reference
Inheritance diagram for PlatformerPro.EnemySpawner:
PlatformerPro.Spawner PlatformerPro.Pool

Public Attributes

int maxAlive
 How many enemies can be alive at any one time. More...
 
- Public Attributes inherited from PlatformerPro.Spawner
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...
 
override void Reset (GameObject instance)
 Reset the specified instance. Specific implementations should override this. More...
 
override IEnumerator Spawn ()
 Coroutine that spawns enemies. More...
 
virtual bool CheckAliveCount ()
 Check we don't have too many enemies alive and thus can't spawn. More...
 
- Protected Member Functions inherited from PlatformerPro.Spawner
override void Init ()
 Initialise pool. 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...
 

Protected Attributes

int defaultHealth
 The default health to restore when resetting More...
 
bool defaultCanCharacterFall
 The default can cahracter fall setting to restore. here because often death movements change this. More...
 
- Protected Attributes inherited from PlatformerPro.Spawner
int spawnsRemaining
 How many spwns remain. More...
 
- Protected Attributes inherited from PlatformerPro.Pool
int currentPosition
 Current position in pool. More...
 

Additional Inherited Members

- Public Member Functions inherited from PlatformerPro.Spawner
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...
 

Member Function Documentation

◆ CheckAliveCount()

virtual bool PlatformerPro.EnemySpawner.CheckAliveCount ( )
protectedvirtual

Check we don't have too many enemies alive and thus can't spawn.

Returns
true, if alive count was checked, false otherwise.

◆ Init()

override void PlatformerPro.EnemySpawner.Init ( )
protectedvirtual

Initialise pool.

Reimplemented from PlatformerPro.Pool.

◆ Reset()

override void PlatformerPro.EnemySpawner.Reset ( GameObject  instance)
protectedvirtual

Reset the specified instance. Specific implementations should override this.

Parameters
instanceInstance.

Reimplemented from PlatformerPro.Pool.

◆ Spawn()

override IEnumerator PlatformerPro.EnemySpawner.Spawn ( )
protectedvirtual

Coroutine that spawns enemies.

Reimplemented from PlatformerPro.Spawner.

Member Data Documentation

◆ defaultCanCharacterFall

bool PlatformerPro.EnemySpawner.defaultCanCharacterFall
protected

The default can cahracter fall setting to restore. here because often death movements change this.

◆ defaultHealth

int PlatformerPro.EnemySpawner.defaultHealth
protected

The default health to restore when resetting

◆ maxAlive

int PlatformerPro.EnemySpawner.maxAlive

How many enemies can be alive at any one time.


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