ForestBridges
A class in Root.Township, Alta.Forests.
Forest generation step that places bridges, as spline instructions, where paths cross rivers.
- Listed in World generation
- Inherits or implements
MonoBehaviour,IForestGeneration - Nested types
Option - Documented in Forest
Constructors
| Member | What it is |
|---|---|
ForestBridges() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|---|
private bool btnMigrate | Inspector button for Migrate. |
private ForestBridges.Option[] options | Bridge styles with offsets, handle lengths, heights and pick weights. |
private float riverWidthMultiplier | Scales river radius to place the bank lines. |
private float totalWeights | Sum of option weights, worked out on first use. |
Methods
| Member | What it is |
|---|---|
void ClearStatic(LocationChunk chunk) | Does nothing. |
void Initialize() | Does nothing. |
6 private and internal methods
| Member | What it is |
|---|---|
private void Alta.Forests.IForestGeneration.ClearDynamic(LocationChunk chunk) | Does nothing. |
private Task Alta.Forests.IForestGeneration.GenerateDynamic(ForestGeneration forest, LocationChunk chunk) | Does nothing. |
private Task Alta.Forests.IForestGeneration.GenerateGlobal(ForestGeneration forest) | Does nothing. |
private Task Alta.Forests.IForestGeneration.GenerateStatic(ForestGeneration forest, LocationChunk chunk, InstructionSet instructions) | For each river crossing in the chunk, finds the path on both banks, picks a weighted bridge option and adds a spline between the banks. |
private Path GetOverlap(Edge edge, float pathProgress, Vector2 start, Vector2 end, out float progress) | Finds the path (the edge or one leaving its nearer node) that crosses the given bank line, and where. |
private void Migrate() | Editor button: makes a StaticEnvironmentPieceInstance on each option's display object. |