86 lines
2.1 KiB
C#
86 lines
2.1 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 InventoryChangedEvent InventoryChangedEvent = new();
|
|
}
|
|
|
|
public static class RestaurantEvents
|
|
{
|
|
public static ItemSlotSelectedEvent ItemSlotSelectedEvent = new();
|
|
public static TodayMenuChangedEvent TodayMenuChangedEvent = new();
|
|
}
|
|
|
|
// 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 = new();
|
|
|
|
public Task WaitAsync() => CompletionSource.Task;
|
|
}
|
|
|
|
public class FadeOutEvent : IEvent
|
|
{
|
|
public float Duration;
|
|
public TaskCompletionSource<bool> CompletionSource = new();
|
|
|
|
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 InventoryChangedEvent : IEvent
|
|
{
|
|
public string ItemId;
|
|
public int NewCount;
|
|
}
|
|
|
|
#region RestaurantEvents
|
|
|
|
public class ItemSlotSelectedEvent : IEvent
|
|
{
|
|
public ItemViewModel Model;
|
|
}
|
|
|
|
public class TodayMenuChangedEvent : IEvent {}
|
|
|
|
#endregion
|
|
}
|