ForestDefinedAtmosphere
A class in Root.Township, Alta.Environmental.Atmosphere.
Blends from the overworld atmosphere to a forest's own atmosphere as the local player goes deeper inside the forest's outline. Updates on clients.
- Listed in World, chunks and saving
- Inherits or implements
NetworkEntityBehaviour - Documented in Time and environment
Constructors
| Member | What it is |
|---|---|
ForestDefinedAtmosphere() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private ForestGenerator forest | The forest generator whose outline defines the area. |
private AtmosphereSet forestSet | Atmosphere used deep in the forest. |
private float fullDepth | Distance in from the forest border at which the forest set is fully applied. |
private ForestGeneration generation | The forest's generated layout, fetched once it exists. |
private float lastStrength | Last blend amount, 0 outside the forest to 1 at full depth. |
private AtmosphereSet overworldSet | Atmosphere used outside the forest. |
private IUnityUpdateMethod update | Registered per-frame update. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Client: registers the per-frame update. Also hooks the atmosphere manager's set resolving. |
2 private and internal methods
| Member | What it is |
|---|---|
private void Resolve(ref AtmosphereSet set) | Swaps the overworld set for the forest set while the player is inside the forest. |
private void UpdateAtmosphere() | Per frame: blends ambient, fog density and ambience audio by how far inside the forest the player's head is. |