Skip to main content

BiomeSphereGenerator

A class in Root.Township, the global namespace.

World generation modifier that places biome spheres on the forest's nodes, from child BiomeSphereComponents plus randomly placed ones.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private Distribution distributionPicks which ForestBiome a random sphere gets, from the node's attributes.
private ForestGeneration lastThe forest from the last Modify call.
private float maxCompetitionScoreA random sphere is skipped if an existing biome already scores above this at the node. Defaults to 0.5.
private float nodeToAttemptRatioNumber of random sphere attempts per node. Defaults to 1.
private BiomeSphere[] spheresSpheres made from the child components.

Methods​

MemberWhat it is
override Task FinishInitialize()Initialises BiomeResources and completes at once.
override void Modify(ForestGeneration forest)Registers the fixed spheres, then tries random nodes and adds a random biome sphere where no existing biome scores above maxCompetitionScore.
void Regenerate()Runs Modify again on the last forest.
1 private and internal method
MemberWhat it is
private async void Awake()Creates a BiomeSphere from each child BiomeSphereComponent.

Used in​

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