30 lines
670 B
C#
30 lines
670 B
C#
using System;
|
|
|
|
namespace UltimateWater
|
|
{
|
|
public static class WaterEvents
|
|
{
|
|
public enum GlobalEventType
|
|
{
|
|
OnQualityChanged = 0
|
|
}
|
|
|
|
public static void AddListener(Action action, GlobalEventType type)
|
|
{
|
|
if (type == GlobalEventType.OnQualityChanged && !(WaterQualitySettings.Instance == null))
|
|
{
|
|
WaterQualitySettings.Instance.Changed -= action;
|
|
WaterQualitySettings.Instance.Changed += action;
|
|
}
|
|
}
|
|
|
|
public static void RemoveListener(Action action, GlobalEventType type)
|
|
{
|
|
if (type == GlobalEventType.OnQualityChanged && !(WaterQualitySettings.Instance == null))
|
|
{
|
|
WaterQualitySettings.Instance.Changed -= action;
|
|
}
|
|
}
|
|
}
|
|
}
|