Loading...
Searching...
No Matches
PixelCrushers.QuestMachine.ServerSpawner Class Reference

Mirror-enabled version of Spawner that does network-aware spawning from the server. More...

Inheritance diagram for PixelCrushers.QuestMachine.ServerSpawner:
Collaboration diagram for PixelCrushers.QuestMachine.ServerSpawner:

Public Member Functions

override void StartSpawning ()
 Starts spawning.
 
override void StopSpawning ()
 Stops spawning.
 
override void DespawnAll ()
 Stops spawning and despawns all spawned entities.
 
- Public Member Functions inherited from PixelCrushers.QuestMachine.Spawner
virtual void OnMessage (MessageArgs messageArgs)
 Handles a message that the message handler is listening for.
 
virtual void AddRestoredEntity (SpawnedEntity spawnedEntity)
 

Protected Member Functions

override void Awake ()
 
override GameObject InstantiateEntity (GameObject prefab)
 Returns an instance of a prefab.
 
- Protected Member Functions inherited from PixelCrushers.QuestMachine.Spawner
virtual void Start ()
 
virtual IEnumerator StartSpawningAfterSaveDataApplied ()
 
virtual void OnDestroy ()
 
virtual void RegisterWithMessageSystem ()
 
virtual void UnregisterWithMessageSystem ()
 
virtual IEnumerator SpawnCoroutine ()
 This coroutine runs until killed, spawning entities so the count remains between min and max.
 
virtual void SetupSpawnpoints ()
 Prepares for spawning.
 
virtual void SpawnAndPlaceEntity ()
 Spawns an entity and places it in the scene.
 
virtual bool IsThereSpaceForEntity ()
 Checks if there is space (e.g., an available spawnpoint) for the entity.
 
virtual void PlaceSpawnedEntity (SpawnedEntity spawnedEntity)
 Places a spawned entity in the scene.
 
void PlaceSpawnedEntityInRadius (SpawnedEntity spawnedEntity)
 Places an entity within the specified radius of the spawner.
 
virtual void PlaceSpawnedEntityInSpawnpoint (SpawnedEntity spawnedEntity)
 Places an entity at an available spawnpoint.
 
virtual void RemoveSpawnedEntity (SpawnedEntity spawnedEntity)
 Removes an entity from the spawnedEntities list.
 
virtual SpawnedEntity SpawnEntity ()
 Spawns an entity and returns the SpawnedEntity component on it, adding the component if necessary.
 
virtual PrefabInfo ChooseWeightedRandomPrefab ()
 
virtual void DespawnEntity (SpawnedEntity spawnedEntity)
 Despawns an entity.
 
virtual void DestroyEntity (GameObject go)
 Destroys an instance of a prefab.
 
virtual void OnSpawnedEntityDisabled (SpawnedEntity spawnedEntity)
 Invoked by a SpawnedEntity when it's disabled.
 

Additional Inherited Members

- Static Public Member Functions inherited from PixelCrushers.QuestMachine.Spawner
static Spawner FindSpawner (string spawnerName)
 
- Protected Attributes inherited from PixelCrushers.QuestMachine.Spawner
List< int > m_availablePositions = new List<int>()
 
- Static Protected Attributes inherited from PixelCrushers.QuestMachine.Spawner
static List< Spawnerm_spawners = new List<Spawner>()
 
- Properties inherited from PixelCrushers.QuestMachine.Spawner
StringField spawnerName [get, set]
 Name by which Quest Machine can reference this spawner.
 
PrefabInfo[] prefabs [get, set]
 Prefabs to spawn.
 
PositionInfo positionInfo [get, set]
 Where to spawn.
 
List< SpawnedEntityspawnedEntities [get, set]
 Entities that have been spawned.
 
bool spawnAsRootObjects [get, set]
 Make spawned entities root objects instead of children of spawner.
 
int min [get, set]
 Minimum number of entities to spawn.
 
int max [get, set]
 Maximum number of entities to spawn.
 
float spawnRate [get, set]
 Once above the minimum, spawn one entity at this frequency in seconds.
 
bool autoStart [get, set]
 Start spawning as soon as this component starts.
 
bool autoStartAfterSaveDataApplied [get, set]
 If Auto Start is ticked, wait for save data to be applied if loading a saved game or changing scenes.
 
bool stopWhenMinReached [get, set]
 Stop spawning as soon as the minimum number of entities has been reached.
 
bool despawnOnDestroy [get, set]
 Despawn all spawned entities when this component is destroyed.
 
int spawnCount [get, set]
 

Detailed Description

Mirror-enabled version of Spawner that does network-aware spawning from the server.

Member Function Documentation

◆ Awake()

override void PixelCrushers.QuestMachine.ServerSpawner.Awake ( )
inlineprotectedvirtual

◆ DespawnAll()

override void PixelCrushers.QuestMachine.ServerSpawner.DespawnAll ( )
inlinevirtual

Stops spawning and despawns all spawned entities.

Reimplemented from PixelCrushers.QuestMachine.Spawner.

◆ InstantiateEntity()

override GameObject PixelCrushers.QuestMachine.ServerSpawner.InstantiateEntity ( GameObject  prefab)
inlineprotectedvirtual

Returns an instance of a prefab.

Override this method if you want to use a pooling system instead of Instantiate.

Reimplemented from PixelCrushers.QuestMachine.Spawner.

◆ StartSpawning()

override void PixelCrushers.QuestMachine.ServerSpawner.StartSpawning ( )
inlinevirtual

Starts spawning.

May stop automatically if stopWhenMinReached is true.

Reimplemented from PixelCrushers.QuestMachine.Spawner.

◆ StopSpawning()

override void PixelCrushers.QuestMachine.ServerSpawner.StopSpawning ( )
inlinevirtual

Stops spawning.

Reimplemented from PixelCrushers.QuestMachine.Spawner.


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