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
| Member | What it is |
|---|
BiomeSphereGenerator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private Distribution distribution | Picks which ForestBiome a random sphere gets, from the node's attributes. |
private ForestGeneration last | The forest from the last Modify call. |
private float maxCompetitionScore | A random sphere is skipped if an existing biome already scores above this at the node. Defaults to 0.5. |
private float nodeToAttemptRatio | Number of random sphere attempts per node. Defaults to 1. |
private BiomeSphere[] spheres | Spheres made from the child components. |
Methods
| Member | What 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
Used in
Members of other types that take, return or hold a BiomeSphereGenerator: