Kaira Digital ArtsKaira Digital Arts
Sayfalar (23)Events Module

Events Module

Son güncelleme: 6 Ekim 2026

Bu sayfa henüz Türkçeye çevrilmedi, İngilizcesi gösteriliyor.

Turns time and weather into UnityEvents you can wire up in the inspector without code: close shops at night, switch street lights on at sunset, start a cutscene at a named hour.

Events

EventFires when
onSecondPassed, onMinutePassed, onHourPassedAn in-game second, minute or hour passes
onDayStarted, onNightStartedThe clock passes the Time Module's day start or night start
onSunrise, onSunsetThe clock passes the sunrise or sunset time
customEventsA named custom time from the Time Module is reached
onWeatherEffectStarted(string)A weather starts. The argument is its name
onWeatherEffectStopped(string)A weather ends
onWeatherChanged(string)The active weather changes

Custom time events

  1. On the Time Module, open Events and press + Add Event. Give it a name and a time.
  2. On the Events Module, add an entry to customEvents with exactly the same name and wire its onTrigger.

Custom events fire once per day. After jumping the clock, ResetAllEventTriggers() clears the once per day flags.

From code

csharp
using KairaDigitalArts;
using UnityEngine;

public class StreetLights : MonoBehaviour
{
    void Start()
    {
        var events = EasyWeatherManager.instance.eventsModule;
        events.onSunset.AddListener(TurnOn);
        events.onSunrise.AddListener(TurnOff);
        events.onWeatherEffectStarted.AddListener(name => Debug.Log(name + " started"));
    }

    void TurnOn()  { /* ... */ }
    void TurnOff() { /* ... */ }
}

Bu sayfaya bağlantı veren sayfalar

Hâlâ takıldınız mı?

Unity sürümünüzü, render pipeline bilginizi ve sorunun ekran görüntüsünü gönderin.

Destek alın