Skip to main content

EnvironmentHandler

A class in Root.Township, the global namespace.

Client component that blends audio environment settings (reverb) towards the current EnvironmentNode over time.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private float adjustSecondsSeconds a full blend takes. Defaults to 1.
private EnvironmentNode defaultEnvironmentEnvironment used when no other is set.

Properties​

MemberWhat it is
EnvironmentLerp Environment { get; private set; }The EnvironmentLerp that tracks the target environment and the blended values.

Methods​

4 private and internal methods
MemberWhat it is
private void Awake()Creates the EnvironmentLerp from the default node and hooks its events.
private void TargetChanged()Turns the component on when the target environment changes, so Update runs.
private void Update()Advances the blend and turns the component off once it is done.
private void UpdateReverb(float reverb)Called when the blended reverb changes. Empty in this build.

Used in​

Members of other types that take, return or hold a EnvironmentHandler: