Ui관련 게임 이벤트 추가

This commit is contained in:
NTG_Lenovo 2025-07-21 16:56:12 +09:00
parent 5323cccaaf
commit 5bd780214a

View File

@ -1,18 +1,100 @@
using System;
using System.Threading.Tasks;
using UnityEngine;
namespace DDD
{
public static class GameEvents
// public static class GameEvents
// {
// public static RequestTimeScaleChangeEvent RequestTimeScaleChangeEvent = new();
// public static RequestShowGlobalMessageEvent RequestShowGlobalMessageEvent = new();
// public static InteractionEvent Interaction = new InteractionEvent();
// }
// public static class RestaurantEvents
// {
// // Some events...
// }
// public static class VoyageEvents
// {
// // Some events...
// }
public class TimeScaleChangeEvent : IEvent
{
public static InteractionEvent Interaction = new InteractionEvent();
public readonly object Requester;
public readonly float NewTimeScale;
public TimeScaleChangeEvent(object requester, float newTimeScale)
{
Requester = requester;
NewTimeScale = newTimeScale;
}
}
public static class RestaurantEvents
public class FadeInEvent : IEvent
{
// Some events...
public readonly float Duration;
public readonly TaskCompletionSource<bool> CompletionSource;
public FadeInEvent(float duration)
{
Duration = duration;
CompletionSource = new TaskCompletionSource<bool>();
}
public Task WaitAsync() => CompletionSource.Task;
}
public static class VoyageEvents
public class FadeOutEvent : IEvent
{
// Some events...
public readonly float Duration;
public readonly TaskCompletionSource<bool> CompletionSource;
public FadeOutEvent(float duration)
{
Duration = duration;
CompletionSource = new TaskCompletionSource<bool>();
}
public Task WaitAsync() => CompletionSource.Task;
}
public class ShowGlobalMessageEvent : IEvent
{
public readonly string NewMessageKey;
public readonly float ShowDuration;
public readonly float FadeDuration;
public ShowGlobalMessageEvent(string newMessageKey, float showDuration = 3f, float fadeDuration = 0.3f)
{
NewMessageKey = newMessageKey;
ShowDuration = showDuration;
FadeDuration = fadeDuration;
}
}
public class OpenScreenUiEvent : IEvent
{
public readonly Type UiType;
public OpenScreenUiEvent(Type uiType) => UiType = uiType;
}
public class CloseScreenUiEvent : IEvent
{
public readonly Type UiType;
public CloseScreenUiEvent(Type uiType) => UiType = uiType;
}
public class OpenPopupUiEvent : IEvent
{
public readonly Type UiType;
public OpenPopupUiEvent(Type uiType) => UiType = uiType;
}
public class ClosePopupUiEvent : IEvent
{
public readonly Type UiType;
public ClosePopupUiEvent(Type uiType) => UiType = uiType;
}
public class InteractionEvent : IEvent