Skip to main content

SpawnerPart

A class in Root.Township, the global namespace.

Generation part that spawns one network prefab at its position (or at a random one of its randomParent transforms) when the generator runs. Server side, as part of world generation.

Constructors​

MemberWhat it is
SpawnerPart()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private ObjectPipeline prefabObject pipeline that resolves to the NetworkPrefab to spawn.
private Transform[] randomParentOptional spawn points; one is picked at random and the spawned entity is parented to it.

Properties​

MemberWhat it is
NetworkEntity LastSpawned { get; private set; }The entity spawned by the last GenerateDynamic call.

Methods​

MemberWhat it is
override void GenerateDynamic(GenerationCore core)Picks a prefab from the pipeline and spawns it at the chosen transform, as a child of the chunking parent if there is one, else in the chunk.

Used in​

Members of other types that take, return or hold a SpawnerPart: