From 5bd780214ad4c0cc96b543a97745ad7b03739422 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Mon, 21 Jul 2025 16:56:12 +0900 Subject: [PATCH] =?UTF-8?q?Ui=EA=B4=80=EB=A0=A8=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_DDD/_Scripts/GameEvent/GameEvents.cs | 94 ++++++++++++++++++-- 1 file changed, 88 insertions(+), 6 deletions(-) diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs index 9f26685c4..bea45909c 100644 --- a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs +++ b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs @@ -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 CompletionSource; + + public FadeInEvent(float duration) + { + Duration = duration; + CompletionSource = new TaskCompletionSource(); + } + + public Task WaitAsync() => CompletionSource.Task; } - public static class VoyageEvents + + public class FadeOutEvent : IEvent { - // Some events... + public readonly float Duration; + public readonly TaskCompletionSource CompletionSource; + + public FadeOutEvent(float duration) + { + Duration = duration; + CompletionSource = new TaskCompletionSource(); + } + + 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