93 lines
1.6 KiB
C#
93 lines
1.6 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
public class EnviroEvents : MonoBehaviour
|
|
{
|
|
[Serializable]
|
|
public class EnviroActionEvent : UnityEvent
|
|
{
|
|
}
|
|
|
|
public EnviroActionEvent onHourPassedActions = new EnviroActionEvent();
|
|
|
|
public EnviroActionEvent onDayPassedActions = new EnviroActionEvent();
|
|
|
|
public EnviroActionEvent onYearPassedActions = new EnviroActionEvent();
|
|
|
|
public EnviroActionEvent onWeatherChangedActions = new EnviroActionEvent();
|
|
|
|
public EnviroActionEvent onSeasonChangedActions = new EnviroActionEvent();
|
|
|
|
public EnviroActionEvent onNightActions = new EnviroActionEvent();
|
|
|
|
public EnviroActionEvent onDayActions = new EnviroActionEvent();
|
|
|
|
private void Start()
|
|
{
|
|
EnviroSky.instance.OnHourPassed += delegate
|
|
{
|
|
HourPassed();
|
|
};
|
|
EnviroSky.instance.OnDayPassed += delegate
|
|
{
|
|
DayPassed();
|
|
};
|
|
EnviroSky.instance.OnYearPassed += delegate
|
|
{
|
|
YearPassed();
|
|
};
|
|
EnviroSky.instance.OnWeatherChanged += delegate
|
|
{
|
|
WeatherChanged();
|
|
};
|
|
EnviroSky.instance.OnSeasonChanged += delegate
|
|
{
|
|
SeasonsChanged();
|
|
};
|
|
EnviroSky.instance.OnNightTime += delegate
|
|
{
|
|
NightTime();
|
|
};
|
|
EnviroSky.instance.OnDayTime += delegate
|
|
{
|
|
DayTime();
|
|
};
|
|
}
|
|
|
|
private void HourPassed()
|
|
{
|
|
onHourPassedActions.Invoke();
|
|
}
|
|
|
|
private void DayPassed()
|
|
{
|
|
onDayPassedActions.Invoke();
|
|
}
|
|
|
|
private void YearPassed()
|
|
{
|
|
onYearPassedActions.Invoke();
|
|
}
|
|
|
|
private void WeatherChanged()
|
|
{
|
|
onWeatherChangedActions.Invoke();
|
|
}
|
|
|
|
private void SeasonsChanged()
|
|
{
|
|
onSeasonChangedActions.Invoke();
|
|
}
|
|
|
|
private void NightTime()
|
|
{
|
|
onNightActions.Invoke();
|
|
}
|
|
|
|
private void DayTime()
|
|
{
|
|
onDayActions.Invoke();
|
|
}
|
|
}
|