Skip to main content

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.

Constructors​

MemberWhat it is
ForestDefinedAtmosphere()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

7 private and internal fields
MemberWhat it is
private ForestGenerator forestThe forest generator whose outline defines the area.
private AtmosphereSet forestSetAtmosphere used deep in the forest.
private float fullDepthDistance in from the forest border at which the forest set is fully applied.
private ForestGeneration generationThe forest's generated layout, fetched once it exists.
private float lastStrengthLast blend amount, 0 outside the forest to 1 at full depth.
private AtmosphereSet overworldSetAtmosphere used outside the forest.
private IUnityUpdateMethod updateRegistered per-frame update.

Methods​

MemberWhat it is
override void Initialize()Client: registers the per-frame update. Also hooks the atmosphere manager's set resolving.
2 private and internal methods
MemberWhat 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.