Skip to main content

StaticDynamicSpawner

A class in Root.Township, the global namespace.

Static generation step that spawns one networked prefab (picked by an ObjectPipeline) at its own transform, saved as a child of the dynamic parent. Server side, run through StaticGenerationHelper.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private GameObject editorPreviewPreview object shown in the editor; cleared by Reset.
private GeneratedPositioning positioningOptional GeneratedPositioning that tweaks the spawn position and rotation.
private ObjectPipeline prefabPipeline that picks the NetworkPrefab to spawn.

Methods​

2 private and internal methods
MemberWhat it is
private void IStaticGeneration.Generate(NetworkEntity dynamicParent, SpawnData spawnData)Spawns the chosen NetworkPrefab at this transform (adjusted by positioning) as a saved child of dynamicParent, but only when SpawnData says this is a generating first load.
private void IStaticGeneration.Reset()Destroys the editor preview object, if any.