NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/Utils.UI.cs

29 lines
1009 B
C#
Raw Normal View History

2024-01-10 14:31:25 +08:00
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
namespace Gameplay.UI
{
public partial class Utils
{
2024-07-11 16:15:45 +08:00
public static async UniTask ShowLoadingUI(E_LoadingType type, bool closeOthers)
2024-01-10 14:31:25 +08:00
{
2024-07-11 16:15:45 +08:00
switch (type)
{
2024-07-12 15:21:16 +08:00
case E_LoadingType.Login:
2024-07-11 16:15:45 +08:00
{
UIWindow ui = await UI_LoadingProgressInterfaceController.Open();
if (closeOthers && ui != null)
2024-08-12 19:31:50 +08:00
UIManager.Instance.CloseAllNormalExcept(UINameConst.UI_LoadingProgressInterface, false);
2024-07-11 16:15:45 +08:00
}
break;
default:
{
2024-07-12 16:17:40 +08:00
UIWindow ui = await UI_LoadingInterfaceController.Open();
2024-07-11 16:15:45 +08:00
if (closeOthers && ui != null)
2024-08-12 19:31:50 +08:00
UIManager.Instance.CloseAllNormalExcept(UINameConst.UI_LoadingInterface, false);
2024-07-11 16:15:45 +08:00
}
break;
}
2024-01-10 14:31:25 +08:00
}
}
}