ProjectDDD/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs
2025-07-22 13:09:38 +09:00

76 lines
1.9 KiB
C#

using System;
using System.Threading.Tasks;
using UnityEngine;
namespace DDD
{
public static class GameEvents
{
public static TimeScaleChangeEvent RequestTimeScaleChangeEvent = new();
public static FadeInEvent FadeInEvent = new();
public static FadeOutEvent FadeOutEvent = new();
public static OpenPopupUiEvent OpenPopupUiEvent = new();
public static ClosePopupUiEvent ClosePopupUiEvent = new();
public static ShowGlobalMessageEvent RequestShowGlobalMessageEvent = new();
public static InteractionEvent Interaction = new();
public static InventoryChangedEvent InventoryChangedEvent = new();
}
// public static class RestaurantEvents
// {
// // Some events...
// }
// public static class VoyageEvents
// {
// // Some events...
// }
public class TimeScaleChangeEvent : IEvent
{
public object Requester;
public float NewTimeScale;
}
public class FadeInEvent : IEvent
{
public float Duration;
public TaskCompletionSource<bool> CompletionSource;
public Task WaitAsync() => CompletionSource.Task;
}
public class FadeOutEvent : IEvent
{
public float Duration;
public TaskCompletionSource<bool> CompletionSource;
public Task WaitAsync() => CompletionSource.Task;
}
public class ShowGlobalMessageEvent : IEvent
{
public string NewMessageKey;
public float ShowDuration;
public float FadeDuration;
}
public class OpenPopupUiEvent : IEvent
{
public Type UiType;
}
public class ClosePopupUiEvent : IEvent
{
public Type UiType;
}
public class InteractionEvent : IEvent
{
public GameObject Causer;
public GameObject Target;
}
public class InventoryChangedEvent : IEvent { }
}