Pages (23)Scripting guide
- Overview
- Installation
- Getting started
- Quick Start window
- System overview
- Easy Weather Manager
- Time Module
- Celestial Module
- Cloud Module
- Volumetric clouds
- Cloud shadows
- Fog
- Detail Module
- Weather Effects Module
- Weather presets
- Events Module
- Lens flare occlusion
- Helper components
- Demo scene
- Scripting guide
- Troubleshooting
- FAQ
- Changelog
Scripting guide
Last updated 6 October 2026
All scripts are in the KairaDigitalArts namespace, and everything is reachable from the manager.
using KairaDigitalArts;
var weather = EasyWeatherManager.instance; // null when no manager is enabledReading and setting time
var weather = EasyWeatherManager.instance;
float hour = weather.GetCurrentTime(); // 0 to 24
bool night = weather.IsNightTime();
string clock = weather.timeModule.GetFormattedTime(); // "HH:MM:SS"
weather.timeModule.SetTime(21.5f); // jump to 21:30
weather.timeModule.daySpeed = 60f; // one game hour per real minute
weather.timeModule.enableTimeProgression = false; // stop the clockStarting and stopping weather
var effects = EasyWeatherManager.instance.weatherEffectsModule;
effects.StartWeatherByName("Heavy Rain");
if (effects.IsWeatherActive())
{
Debug.Log("Now: " + effects.GetCurrentWeatherName());
}
effects.StopWeather(); // currentWeather becomes nullWeather started from code does not stop by itself. With automatic weather on, the daily schedule can still start and stop weather around it; turn enableAutomaticWeather off if your game decides the weather alone.
Choosing the next weather
var effects = EasyWeatherManager.instance.weatherEffectsModule;
effects.ScheduleWeatherByName("Snow"); // the preset the automatic system runs next
effects.ForceStartScheduledWeather(); // or start it right nowReacting to time and weather
using KairaDigitalArts;
using UnityEngine;
public class DayListener : MonoBehaviour
{
void OnEnable()
{
var manager = EasyWeatherManager.instance;
if (manager == null) return;
manager.timeModule.OnDayCompletedEvent += OnNewDay;
manager.eventsModule.onWeatherEffectStarted.AddListener(OnWeatherStarted);
}
void OnDisable()
{
var manager = EasyWeatherManager.instance;
if (manager == null) return;
manager.timeModule.OnDayCompletedEvent -= OnNewDay;
manager.eventsModule.onWeatherEffectStarted.RemoveListener(OnWeatherStarted);
}
void OnNewDay()
{
Debug.Log("Day " + EasyWeatherManager.instance.timeModule.GetCurrentDay());
}
void OnWeatherStarted(string weatherName)
{
Debug.Log(weatherName + " started");
}
}Changing the look from code
var manager = EasyWeatherManager.instance;
var celestial = manager.celestialModule;
celestial.SetLightIntensity(0.4f);
celestial.SetAmbientColors(skyColor, equatorColor, groundColor, 0.8f);
float sunThroughClouds = celestial.SunVisibility; // 1 for a clear sky
var clouds = manager.cloudModule;
clouds.cloudCoverage = 0.9f;
clouds.UpdateShaders(); // push the change to the materials
var detail = manager.detailModule;
detail.EnableAurora(true);
detail.SetStarsIntensity(3f); // 0 to 5
detail.auroraIntensity = 2f;
detail.UpdateShaders(); // needed after writing a field directlyThings to know
- Curves win. A value that follows a 24 hour curve or gradient is recomputed every frame. Writing the fixed value from code has no visible effect until you switch that value back to fixed in the inspector.
- Weather restores values. Values a running preset overrides are faded back to the time of day when the weather ends, including any change you made to them in between.
- Edit Mode. The manager runs in Edit Mode. Weather and its scheduling run in Play Mode only, but the clock can run in the editor, so editor-time subscribers to
OnDayCompletedEventshould checkApplication.isPlaying. - Enter Play Mode options. The system keeps no static state between Play sessions, so it works with domain reload and scene reload turned off.
Pages that link here
Still stuck?
Send us your Unity version, render pipeline and a screenshot of the problem.

