AlicizaX/Client/Packages/com.alicizax.unity.ui/Runtime/UI/Base/Manager/UIManager.cs
2025-01-24 16:21:00 +08:00

72 lines
1.8 KiB
C#

using System;
using AlicizaX.Resource.Runtime;
using AlicizaX.Runtime;
using AlicizaX.Timer.Runtime;
using Cysharp.Threading.Tasks;
namespace AlicizaX.UI.Runtime
{
internal sealed partial class UIManager : IUIManager
{
public int Priority { get; }
private ITimerManager _timerManager;
private IResourceManager _resourceManager;
void IModule.Dispose()
{
UITypeCollector.Clean();
}
void IModuleUpdate.Update(float elapseSeconds, float realElapseSeconds)
{
foreach (var value in mShowUIWindow.Values)
{
int count = value.Count;
for (int i = 0; i < value.Count; i++)
{
if (value.Count != count)
{
break;
}
var window = value[i];
window.UIBasePanel.InternalUpdate();
}
}
}
public UIWindow ShowUI(Type type, params System.Object[] userDatas)
{
return ShowUIImpl(type, userDatas);
}
public async UniTask<UIWindow> ShowUIAsync(Type type, params System.Object[] userDatas)
{
return await ShowUIImplAsync(type, userDatas);
}
public void CloseUI(Type type, bool force = false)
{
CloseUIImpl(type, force);
}
public UIWindow GetUI(Type type)
{
return GetUIInstance(type);
}
void IUIManager.SetTimerManager(ITimerManager timerManager)
{
_timerManager = timerManager;
}
void IUIManager.SetResourceManager(IResourceManager resourceManager)
{
_resourceManager = resourceManager;
}
}
}