Skip to main content

StaticGeneration

A class in Root.Township, the global namespace.

Static generation step that instantiates a plain (non-networked) prefab under itself, then runs static generation on the new object. Driven by StaticGenerationHelper.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private GameObjectDistribution optionsObsolete prefab distribution, only used when prefab has no input.
private GeneratedPositioning positioningOptional GeneratedPositioning that tweaks the spawn position and rotation.
private ObjectPipeline prefabPipeline that picks the GameObject prefab to instantiate.
private GameObject spawnedThe object this component instantiated last.

Methods​

2 private and internal methods
MemberWhat it is
private void IStaticGeneration.Generate(NetworkEntity dynamicParent, SpawnData spawnData)Destroys any previous result, picks a prefab from prefab (or the obsolete options if the pipeline has no input), instantiates it here and generates its children.
private void IStaticGeneration.Reset()Destroys the spawned object.