CTT/Unity/Assets/HotfixView/Event/UI/NetLoadingEvent.cs

36 lines
1.0 KiB
C#

using ET;
using ET.EventType;
namespace ET
{
public class NetLoadingEvent
{
private static bool isShowing;
public class PlayNetLoadingEvent : AEvent_Sync<PlayNetLoading>
{
private FUI_NetLoading ui;
public override void Run(PlayNetLoading a)
{
if (isShowing) return;
if (ui == null)
{
ui = FUI_NetLoading.CreateInstance(FUIComponent.Instance);
ui.Name = FUIPackage.Common_NetLoading;
ui.self.sortingOrder = 9999;
ui.MakeFullScreen();
}
isShowing = true;
FUIComponent.Instance.Add(ui, true);
}
}
public class StopNetLoadngEvent : AEvent_Sync<StopNetLoading>
{
public override void Run(StopNetLoading a)
{
isShowing = false;
FUIComponent.Instance.Get(FUIPackage.Common_NetLoading)?.RemoveSelfNoDispose();
}
}
}
}