Skip to main content

SetPrefabModifier

A class in Root.Township, the global namespace.

Forest fill spawn modifier that sets each spawn point's prefab to a static environment piece, from a list or a pipeline. Points with no piece get weight 0.

Constructors​

MemberWhat it is
SetPrefabModifier()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

5 private and internal fields
MemberWhat it is
private bool btnMigrateInspector button that calls Migrate.
private ObjectPipeline piecePipelinePipeline that gives a StaticEnvironmentPieceInstance, used when pieces is empty.
private StaticEnvironmentPieceInstance[] piecesPieces to pick from at random.
private ObjectPipeline pipelineOld GameObject pipeline. Not used by Filter.
private GameObject[] prefabsOld GameObject list. Not used by Filter.

Methods​

MemberWhat it is
override void Filter(ForestFillCore.Setup setup, ref SpawnParameters point, ref float weight)Picks a random entry from pieces, or from piecePipeline if the list is empty; sets weight to 0 if nothing came back.
1 private and internal method
MemberWhat it is
private void Migrate()Empty in this build.