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

Spawns random items. More...

Inheritance diagram for PlatformerPro.RandomItemSpawner:

Public Member Functions

bool Spawn ()
 Spawn this instance. More...
 

Public Attributes

List< GameObject > itemPrefabs
 List of prefabs we can spawn. To change liklihood of spawning different items just add more items of the same type. More...
 
Vector3 spawnPositionOffset
 The spawn position offset. More...
 
List< Vector3 > spawnVelocities
 The spawn velocity. More...
 
int numberToSpawn = 1
 The number to spawn. More...
 
int spawnsPerHit = 1
 The number to spawn. More...
 
bool removeFromListOnSpawn
 After an item spawns should we remove it from the list? Handy if you want to spawn an exact set of items in random order or if you don't want to spawn rare items more than once. More...
 

Protected Member Functions

void OnSpawned ()
 Raises the spawned event. More...
 

Events

System.EventHandler< System.EventArgs > Spawned
 Occurs when an item is spawned. More...
 

Detailed Description

Spawns random items.

Member Function Documentation

◆ OnSpawned()

void PlatformerPro.RandomItemSpawner.OnSpawned ( )
protected

Raises the spawned event.

◆ Spawn()

bool PlatformerPro.RandomItemSpawner.Spawn ( )

Spawn this instance.

Returns
true if there are items left to spawn or false otherwise.

Member Data Documentation

◆ itemPrefabs

List<GameObject> PlatformerPro.RandomItemSpawner.itemPrefabs

List of prefabs we can spawn. To change liklihood of spawning different items just add more items of the same type.

◆ numberToSpawn

int PlatformerPro.RandomItemSpawner.numberToSpawn = 1

The number to spawn.

◆ removeFromListOnSpawn

bool PlatformerPro.RandomItemSpawner.removeFromListOnSpawn

After an item spawns should we remove it from the list? Handy if you want to spawn an exact set of items in random order or if you don't want to spawn rare items more than once.

◆ spawnPositionOffset

Vector3 PlatformerPro.RandomItemSpawner.spawnPositionOffset

The spawn position offset.

◆ spawnsPerHit

int PlatformerPro.RandomItemSpawner.spawnsPerHit = 1

The number to spawn.

◆ spawnVelocities

List<Vector3> PlatformerPro.RandomItemSpawner.spawnVelocities

The spawn velocity.

Event Documentation

◆ Spawned

System.EventHandler<System.EventArgs> PlatformerPro.RandomItemSpawner.Spawned

Occurs when an item is spawned.


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