LakeGenerator
A class in Root.Township, Alta.Forests.
Editor test tool that builds lake meshes where rivers end in a basin. Not part of normal generation.
- Listed in World generation
- Inherits or implements
MonoBehaviour - Documented in Forest
Constructors
| Member | What it is |
|---|---|
LakeGenerator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private List<List<Vector3>> allDebugEdges | Shorelines traced, for gizmos. |
private bool btnRegenerate | Inspector button for Regenerate. |
private Material material | Material for lake meshes. |
private RiverGenerator riverGenerator | River generator to read nodes from. |
private float threshold | Least river volume that makes a lake. |
Methods
4 private and internal methods
| Member | What it is |
|---|---|
private List<Path> EvaluateWaterEdge(float waterHeight, ref Path path) | Walks the shoreline at the water height. Returns null if it doesn't close within 100 steps. |
private void GenerateLake(RiverNode center, float waterHeight) | Builds a flat lake mesh object inside the shoreline at the water height. |
private void OnDrawGizmos() | Draws the traced shorelines. |
private void Regenerate() | Editor button: finds river end nodes with enough volume, works out how high they'd fill and makes lakes. |