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

Description

Component for spawning humanoids.

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

Public Types

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

Public Member Functions

override GameObject SpawnObject ()
 Spawn one humanoid using the HumanoidSpawner settings.
 
virtual HumanoidControl SpawnHumanoid ()
 Spawn one humanoid using the HumanoidSpawner settings.
 
virtual HumanoidControl Spawn (HumanoidControl humanoidPrefab)
 Spawn a humanoid.
 
HumanoidControl Spawn (HumanoidControl humanoidPrefab, SpawnPoint[] spawnPoints, SpawnMethod spawnMethod=SpawnMethod.RoundRobin)
 Spawn a humanoid.
 
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

override void Start ()
 
int FindSpawnPointIndex ()
 
void DestroyHumanoid (HumanoidControl humanoid)
 
virtual void OnEnable ()
 
SpawnPoint ChooseSpawnPoint (SpawnPoint[] spawnPoints, SpawnMethod spawnMethod)
 

Static Protected Member Functions

static HumanoidControl AddHumanoidToAvatar (GameObject avatar)
 

Protected Attributes

HumanoidControl[] spawnedHumanoids
 
int spawnIndex = 0
 

Static Protected Attributes

static int nHumanoids
 

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

◆ Start()

override void Passer.Humanoid.HumanoidSpawner.Start ( )
protectedvirtual

Reimplemented from Passer.Spawner.

◆ SpawnObject()

override GameObject Passer.Humanoid.HumanoidSpawner.SpawnObject ( )
virtual

Spawn one humanoid using the HumanoidSpawner settings.

Returns
The HumanoidControl of the spawned humanoid. Will be null when the humanoid could be not spawned.

Reimplemented from Passer.Spawner.

◆ SpawnHumanoid()

virtual HumanoidControl Passer.Humanoid.HumanoidSpawner.SpawnHumanoid ( )
virtual

Spawn one humanoid using the HumanoidSpawner settings.

Returns
The HumanoidControl of the spawned humanoid. Will be null when the humanoid could be not spawned.

◆ Spawn() [1/4]

virtual HumanoidControl Passer.Humanoid.HumanoidSpawner.Spawn ( HumanoidControl  humanoidPrefab)
virtual

Spawn a humanoid.

Parameters
prefabThe humanoid prefab to spawn.
Returns
The HumanoidControl of the spawned humanoid. Will be null when the humanoid could be not spawned.

◆ Spawn() [2/4]

HumanoidControl Passer.Humanoid.HumanoidSpawner.Spawn ( HumanoidControl  humanoidPrefab,
SpawnPoint[]  spawnPoints,
SpawnMethod  spawnMethod = SpawnMethod::RoundRobin 
)

Spawn a humanoid.

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

◆ Spawn() [3/4]

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

Spawn a GameObject.

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

◆ Spawn() [4/4]

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

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
inherited

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
inherited

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: