Skip to main content

PrefabSceneDayTimeManager

A class in Root.Township, Alta.Environmental.Atmosphere.

Editor tool for prefab scenes: previews the sun, moon, sky and fog for a set time of day while not playing.

Constructors​

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

Fields​

7 private and internal fields
MemberWhat it is
private bool btnConvertInspector button that converts the fog colour gradient each update while ticked.
private static Logger loggerLogger for this class.
private Light moonLightMoon light; found under the moon rotator if not set.
private Transform moonRotatorTransform tagged MoonRotator.
private PrefabSceneSettings settingsPrefab scene settings with the debug time and sky curves.
private Light sunLightSun light; found under the sun rotator if not set.
private Transform sunRotatorTransform tagged SunRotator.

Methods​

4 private and internal methods
MemberWhat it is
private void GradientToGamaConverter(Gradient gradient)Converts a gradient's colours from sRGB to linear. Not called.
private void GradientToLinearConverter(Gradient gradient)Converts a gradient's colours from linear to sRGB. Run by the Convert button on the fog gradient.
private void Update()Edit mode: finds the sun and moon, rotates them for the debug day and month progress, and sets ambient, fog, lights and skybox.
private void UpdateRotation(float dayProgress, float monthProgress)Rotates the sun and moon for a day and month progress and passes their directions to the skybox.