RiverCollision
A class in Root.Township, Alta.Forests.
A forest generation step that spawns box trigger colliders along the overground river, which pass enters and exits to a locomotion modifier and a liquid container (wading and filling from the river).
- Listed in World generation
- Inherits or implements
MonoBehaviour,IForestGeneration
Constructors
| Member | What it is |
|---|---|
RiverCollision() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
13 private and internal fields
| Member | What it is |
|---|---|
private bool btnRegenerate | Inspector button that calls Regenerate. |
private float endCapScale | Length scale for a box end where the river starts or finishes. |
private float endScale | Length scale for a box end that joins another river path. |
private ForestGenerator forest | The forest generator used by Regenerate. |
private float horizontalScale | Box width as a multiple of river width. |
private bool isShowingBoxes | When on, the trigger prefab is a visible cube, for debugging. |
private LiquidContainerTrigger liquidContainer | The liquid trigger that river enters and exits are forwarded to. |
private LocomotionModifier locomotionModifier | The locomotion modifier that river enters and exits are forwarded to. |
private float normalOffset | Offset along each box's up direction. |
private static TriggerShape prefab | Shared, inactive trigger box prefab, built once in Initialize. |
private List<TriggerShape> spawned | The trigger boxes spawned so far. |
private float verticalOffset | Extra world-up offset for each box. |
private float verticalScale | Box height as a multiple of river width. |
Methods
9 private and internal methods
| Member | What it is |
|---|---|
private void Alta.Forests.IForestGeneration.ClearDynamic(LocationChunk chunk) | Does nothing. |
private void Alta.Forests.IForestGeneration.ClearStatic(LocationChunk chunk) | Does nothing. |
private void Entered(Collider collider) | Passes a collider entering any river trigger to the locomotion modifier and liquid container. |
private void Exited(Collider collider) | Passes a collider leaving any river trigger to the locomotion modifier and liquid container. |
private Task Alta.Forests.IForestGeneration.GenerateDynamic(ForestGeneration forest, LocationChunk chunk) | Does nothing. |
private Task Alta.Forests.IForestGeneration.GenerateGlobal(ForestGeneration forest) | Spawns a box trigger for each overground river path, plus one at each river end, sized from the river width. |
private Task Alta.Forests.IForestGeneration.GenerateStatic(ForestGeneration forest, LocationChunk chunk, InstructionSet instruction) | Does nothing. |
private void Alta.Forests.IForestGeneration.Initialize() | Builds the shared trigger box prefab once (a visible cube if isShowingBoxes). |
private void Regenerate() | Destroys the spawned triggers and runs GenerateGlobal again. Wired to an inspector button. |