Kaira Digital ArtsKaira Digital Arts
Pages (23)Scripting guide

Scripting guide

Last updated 6 October 2026

All scripts are in the KairaDigitalArts namespace, and everything is reachable from the manager.

csharp
using KairaDigitalArts;

var weather = EasyWeatherManager.instance;   // null when no manager is enabled

Reading and setting time

csharp
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 clock

Starting and stopping weather

csharp
var effects = EasyWeatherManager.instance.weatherEffectsModule;

effects.StartWeatherByName("Heavy Rain");

if (effects.IsWeatherActive())
{
    Debug.Log("Now: " + effects.GetCurrentWeatherName());
}

effects.StopWeather();   // currentWeather becomes null

Weather 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

csharp
var effects = EasyWeatherManager.instance.weatherEffectsModule;

effects.ScheduleWeatherByName("Snow");   // the preset the automatic system runs next
effects.ForceStartScheduledWeather();    // or start it right now

Reacting to time and weather

csharp
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

csharp
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 directly

Things 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 OnDayCompletedEvent should check Application.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.

Contact support