Humanoid Control for Unity v4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Passer.Spawner Class Reference

Description

Component for spawning objects.

Inheritance diagram for Passer.Spawner:
Passer.SpawnPoint Passer.Humanoid.HumanoidSpawner

Public Types

enum  SpawnMethod { SinglePlayer , Random , RoundRobin }
 Spawning methods. More...
 

Public Member Functions

virtual GameObject SpawnObject ()
 Spawn one GameObject using the Spawner settings.
 
void DoSpawn (GameObject prefab)
 
virtual GameObject Spawn (GameObject prefab)
 Spawn a GameObject.
 
virtual GameObject Spawn (GameObject prefab, SpawnPoint[] spawnPoints, SpawnMethod spawnMethod=SpawnMethod.RoundRobin)
 Spawn a GameObject.
 

Static Public Member Functions

static GameObject Spawn (GameObject prefab, Vector3 position, Quaternion rotation)
 

Public Attributes

GameObject prefab
 The prefab which will be spawned.
 
SpawnPoint[] spawnPoints
 The available SpawnPoints.
 
SpawnMethod spawnMethod
 The SpawnMethod to use for spawning the humanoids.
 
bool spawnAtStart
 Spawn an object when the scene starts.
 
bool singleInstance
 Will spawn only one object for this prefab.
 

Protected Member Functions

virtual void OnEnable ()
 
virtual void Start ()
 
SpawnPoint ChooseSpawnPoint (SpawnPoint[] spawnPoints, SpawnMethod spawnMethod)
 

Protected Attributes

int spawnIndex = 0
 

Member Enumeration Documentation

◆ SpawnMethod

Spawning methods.

Enumerator
SinglePlayer 

Only one humanoid will be spawned. It will be located at the first SpawnPoint.

Random 

A SpawnPoint is chosen randomly.

RoundRobin 

Spawn points are chosen in round robin manner.

Member Function Documentation

◆ SpawnObject()

virtual GameObject Passer.Spawner.SpawnObject ( )
virtual

Spawn one GameObject using the Spawner settings.

Returns
The instantiated GameObject. Will be null when the prefab could not be instantiated.

Reimplemented in Passer.Humanoid.HumanoidSpawner.

◆ Spawn() [1/2]

virtual GameObject Passer.Spawner.Spawn ( GameObject  prefab)
virtual

Spawn a GameObject.

Parameters
prefabThe GameObject prefab to spawn.
Returns
The instantiated GameObject. Will be null when the prefab could not be spawned.

◆ Spawn() [2/2]

virtual GameObject Passer.Spawner.Spawn ( GameObject  prefab,
SpawnPoint[]  spawnPoints,
SpawnMethod  spawnMethod = SpawnMethod::RoundRobin 
)
virtual

Spawn a GameObject.

Parameters
prefabThe GameObject prefab to spawn.
spawnPointsThe array of possible spawn points.
spawnMethodThe SpawnMethod to use for spawning.
Returns
The instantiated GameObject. Will be null when the prefab could not be spawned.

Member Data Documentation

◆ spawnPoints

SpawnPoint [] Passer.Spawner.spawnPoints

The available SpawnPoints.

When the list is empty, the scene will be searched for available spawn points when it becomes enabled. If no spawn points can be found, this transform will be used as a SpawnPoint

◆ singleInstance

bool Passer.Spawner.singleInstance

Will spawn only one object for this prefab.

When spawn is called a second time for the same prefab, the original spawned object will be teleported to the new spawn point


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