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

40 lines
1.4 KiB
C#

using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
using Gameplay.SubSystems;
namespace Gameplay.UI
{
public partial class Utils
{
public static async UniTask ShowLoadingUI(E_LoadingType type, bool closeOthers)
{
switch (type)
{
case E_LoadingType.Login:
{
await UI_LoadingProgressInterfaceController.Open();
if (closeOthers)
UIManager.Instance.CloseAllUIExcept(UINameConst.UI_LoadingProgressInterface);
}
break;
case E_LoadingType.QuickBlack:
{
float animTime = 0.3f;
await UI_LoadingBlackController.Open(animTime);
if (closeOthers)
UIManager.Instance.CloseAllUIExcept(UINameConst.UI_LoadingBlack);
await UniTask.WaitForSeconds(animTime, true);
}
break;
case E_LoadingType.CommonLoading:
default:
{
await UI_LoadingInterfaceController.Open();
if (closeOthers)
UIManager.Instance.CloseAllUIExcept(UINameConst.UI_LoadingInterface);
}
break;
}
}
}
}