0% found this document useful (0 votes)
2 views7 pages

How To Use

The DayNight System v1.1.0 provides a comprehensive package for managing day and night cycles in Unity, featuring a structured API and detailed documentation. Users can quickly set up the system by dragging the DayNightManager prefab into their scene and configuring visual settings, including skybox materials and fog options. Additionally, the system allows for the creation of custom visual modules to enhance the visual representation based on time changes.

Uploaded by

Patata Pea
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

How To Use

The DayNight System v1.1.0 provides a comprehensive package for managing day and night cycles in Unity, featuring a structured API and detailed documentation. Users can quickly set up the system by dragging the DayNightManager prefab into their scene and configuring visual settings, including skybox materials and fog options. Additionally, the system allows for the creation of custom visual modules to enhance the visual representation based on time changes.

Uploaded by

Patata Pea
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DayNight System v1.1.

Thanks a lot for downloading this package! ​


If you enjoy it, consider leaving a rating on the store :)

Below you’ll find instructions on how to get started.​


All the C# code is documented and structured, providing a powerful
API that is easily extensible.

If you have any questions, problems or suggestions, don’t hesitate


to reach out at: [Link]@[Link]

DayNight System v1.1.0.........................................................................................................1


Quick Start..........................................................................................................................2
Visual & Shader Config...................................................................................................... 5
Visual Config................................................................................................................ 5
Skybox Shader............................................................................................................. 6
Visual Modules................................................................................................................... 7
Quick Start

1)​ Drag the DayNightManager prefab into your scene:​

2)​ Set the Skybox material in the Unity Lighting tab to either your own Material
that uses the DayNightSystem/TransitionSkybox shader, or the included Skybox
material in the Resources folder:

3)​ (Optional) Change fog mode to “Linear” if you want dynamic fog distances (in
the Scene Lighting tab):​
4)​ (Optional) Create your own visual preset:​
You can add your own visual presets by creating the scriptable objects. You
can find them in “Create/MGe Labs/DayNightSystem/Visual Config”. You’ll find
detailed instructions below.​
Make sure to assign your preset in the DayNightManager’s Visual Config field.​
If you don’t want the visuals, leave the config field empty.​


5)​ (Optional) Limit the Time​
If you don’t want a full day rotation, but instead have the time stop progressing
at a certain time, you can set a limit. Once reached, the time won’t progress
further until you either call ResetTime() on the DayNightManager (which
resets the time back to the initial start time), or by setting a sooner time than
the limit and then calling ResetTimeLimit(). ​
You can subscribe to the OnTimeLimitReached UnityEvent or
OnTimeLimitReachedAction.​


Visual & Shader Config

Visual Config



SkyMaterial: The Skybox material, you can use the existing one in the Resources folder, or create
your own. For the skybox visuals to work, the material requires the DayNightSystem/TransitionSkybox
shader.

Sky Material Transition Values: Controls how the skybox transitions visually over the course of the
day. Values correspond to points in the day (0 = midnight/dark, 1 = noon/light).

Enable Fog: Enable dynamic fog distance & color

Sky Material Fog Color: The fog/horizon colors of the skybox. The gradient represents the transition
colors over the cycle.

Sky Fog Densities: The sky fog densities over the cycle (should be 4).

Sun Direction: The direction of the sun.

Enable Stars: Won’t do much by itself; if turned off, it will disable stars in the skybox material, if on, it
keeps your stars config.

Enable Colors: Enable ambient and light color changes

Ambient Light Color: The Unity Environment Light “Ambient Color” over a cycle.

Directional Light Color: The directional light / sun color over a cycle.​
Skybox Shader

Transition: The transition amount between day and night (0-1)​


Day Texture: The cubemap texture of the day sky​
Night Texture: The cubemap texture of the night sky​
Star Texture: The cubemap texture of the stars​
Tint: Change the overall color​
Exposure: Adjusts the brightness of the sky

Star Intensity: Controls the brightness of the stars (0-10)​


Star Min Transition: The transition value where stars begin to appear​
Star Max Transition: The transition value where stars are fully visible​
Star Color: Tint color applied to the stars​
Star Visibility: Controls the mix between the stars and the sky​
Twinkle Speed: Speed of the star twinkle animation​
Twinkle Intensity: Strength of the twinkle effect

Fog Color (Sky): The fog color applied to the skybox​


Fog Start: The normalized height where fog begins to appear​
Fog End: The normalized height where fog is at full strength​
Fog Density: Controls how quickly the fog blends with the sky
Visual Modules
You can create modules that you can plug into the DayNightManager, which then react to
time changes in order to represent a visual state.
There is a DayNightVisualModule base-class, that you’ll have to extend.

There is a DayNightParticleSystemModule MonoBehaviour as an example, you can


assign particle systems to it, and it will change the particle’s colors, lifetimes and emission
values based on the current daytime.
This can be useful for dust, fog,.. particles, which will be less visible at night.

In order for the modules to work, you have to assign them to the visual modules in the
DayNightManager:

You might also like