Skip to main content

FogAnimator

A class in Root.Township, the global namespace.

Drives the scene's fog density, fog colour and skybox fade from its own fields every frame, and restores the originals when disabled. Works in edit mode.

Constructors​

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

Fields​

MemberWhat it is
Color fogColorFog colour to apply.
float fogDensityFog density to apply.
float skyBoxFadeValue written to the skybox _Fade.
4 private and internal fields
MemberWhat it is
private static int _FadeShader property ID for the skybox _Fade.
private Color originalFogColorFog colour saved on enable.
private float originalFogDensityFog density saved on enable.
private Material originalSkyBoxSkybox material saved on enable.

Methods​

3 private and internal methods
MemberWhat it is
private void OnDisable()Restores the fog settings and skybox saved on enable.
private void OnEnable()Saves the current fog and skybox, then swaps in a copy of the skybox material.
private void Update()Writes the fields to RenderSettings and the skybox _Fade property.