Pro Day & Night Cycle System
Introduction
The Pro Day & Night Cycle System provides a fully customizable and dynamic environment controller for Unity. It simulates natural or unnatural day and night cycles with adjustable sun and moon movement, skybox blending, real-time ambient lighting, fog transitions, shadow strength control, and audio ambience that changes between day and night.
This system is ideal for open-world games, survival experiences, simulations, and atmospheric projects where a realistic or stylized time-of-day system is required.
Installation
Import the asset via the Unity Package Manager after purchasing it from the Unity Asset Store.
If this is your first time using it, we recommend importing the Demo folder, which includes two demo scenes built on Unity’s Starter Asset (Third Person Controller) . For the demo scenes to work, make sure you also import Cinemachine , Input System and TextMeshPro . For Built-In you must convert the materials for it to work. Go to “Tools>Pro Day Night Cycle>Convert Demo Materlials to Standard”.
If you do not need the demo then you just need to drag DayAndNight.prefab and Lighting.prefab into your scene.
Unity version: 2022.3.7f1. Supports URP and Built-in
Folder Descriptions
- BlendedSkyBox/: Includes a shader and the material necessary to do the blending.
- Documentation/: Pro Day & Night Cycle System - User Manual.pdf.
- Demo/: Contains the free asset and demo scenes to try the asset. Otional for use.
- Prefabs/: Includes DayAndNight.prefab and Lighting.prefab, thoses two will help to set up a scene from scratch.
- Scripts/: Includes the two main scripts of the asset.
Usage
- Running the Demo: In URP, materials work out of the box. For Standard pipeline, use the converter script
ConvertDemoMaterialsToStandard.cs under Tools > URPToStandardConverter to adapt materials.
- Prefab Setup: The main prefab is
DayAndNightc. Its DayNightCycle.cs script handles everything from Time Control to audio settings.
Tool Details
- Time Control:
- Pause Time: Stops in-game time progression (useful for cutscenes).
- Use Computer Time: Synchronizes the in-game time with the player’s system clock.
- Time Settings:
- Time of Day: Current time in hours (0–24).
- Day Duration: Synchronizes the in-game time with the player’s system clock.
- Is Daytime (read-only): Indicates whether the system considers it day.
- Sun Rotation Settings:
- Sunrise Time: Hour at which the sun rises.
- Sunset Time: Hour at which the sun sets.
- Radius: Distance of the sun and moon visuals from the camera.
- Sun Settings:
- Sun (Light): The main Directional Light used for daylight.
- Sun Visual: Optional billboard for rendering the sun in the sky.
- Day/Night Pivot: X-axis rotation for sun movement.
- Direction & Inclination Pivot: Controls sun orientation (Y = direction, Z = tilt).
- Sun Inclination: Tilt of the sun’s path.
- Sun Direction: Global orientation of the sun.
- Sun Intensity Curve: Controls how sunlight intensity evolves throughout the day.
- Sun Color Gradient: Defines sunlight color over time.
- Moon Settings:
- Moon (Light): Directional Light used for moonlight.
- Moon Visual: Optional billboard for moon rendering.
- Day/Night Pivot: X-axis rotation for moon movement.
- Direction & Inclination Pivot: Controls moon orientation (Y = direction, Z = tilt).
- Moon Inclination: Tilt of the moon’s path.
- Moon Direction: Global orientation of the sun.
- Directional Light Intensity at Night: Base moonlight strength.
- Ambient Color Gradient: Controls global ambient lighting through the 24h cycle.
- Skybox Settings:
- Skybox Mode: Cubemap (blended)/Procedural
- Blended Skybox Material: Custom material used for cubemap blending.
- Skybox Day / Skybox Night: Cubemaps for day and night.
- Procedural Skybox Material: Material used for procedural mode.
- Sky Tint Day/Night: Color tint of the sky during day/night.
- Atmosphere Day/Night: Controls thickness of atmosphere during day/night.
- Fog Settings:
- Enable Fog: Toggles fog on/off.
- Fog Color Gradient: Defines fog color across the day-night cycle.
- Fog Density Curve: Defines fog density variation over time.
- Shadows:
- Shadow Strength Curve: Defines shadow intensity based on time of day.
- UI Clock:
- Show Time UI: Displays the current time on screen.
- Time Text: Reference to a TextMeshProUGUI element that displays the formatted time.
- Audio Settings:
- Day Ambience: AudioSource for daytime sounds (birds, wind, etc.).
- Sunset Time: AudioSource for nighttime sounds (crickets, owls, etc.).
- Radius:Smooth transition time between day and night ambience.
Tip
To customize your scene, juste pause the time at the hour you want and make your changes
Every gradient and curve represents a full day, so the colors or values you set will automatically change throughout the day.
See on Unity Asset Store