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

40 lines
1.4 KiB
C#
Raw Normal View History

2024-01-10 14:31:25 +08:00
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
2024-08-28 17:03:50 +08:00
using Gameplay.SubSystems;
2024-01-10 14:31:25 +08:00
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
{
await UI_LoadingProgressInterfaceController.Open();
if (closeOthers)
2024-08-12 19:31:50 +08:00
UIManager.Instance.CloseAllNormalExcept(UINameConst.UI_LoadingProgressInterface, false);
2024-07-11 16:15:45 +08:00
}
break;
2024-08-30 15:58:29 +08:00
case E_LoadingType.QuickBlack:
{
2024-08-30 16:05:54 +08:00
float animTime = 0.3f;
await UI_LoadingBlackController.Open(animTime);
2024-08-30 15:58:29 +08:00
if (closeOthers)
UIManager.Instance.CloseAllNormalExcept(UINameConst.UI_LoadingBlack, false);
2024-08-30 16:05:54 +08:00
await UniTask.WaitForSeconds(animTime, true);
2024-08-30 15:58:29 +08:00
}
break;
2024-08-28 17:03:50 +08:00
case E_LoadingType.CommonLoading:
2024-07-11 16:15:45 +08:00
default:
{
await UI_LoadingInterfaceController.Open();
if (closeOthers)
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
}
}
}