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; void IModule.Dispose() { UITypeCollector.Clean(); } void IModuleUpdate.Update(float elapseSeconds, float realElapseSeconds) { // 遍历所有层级 for (int layerIndex = 0; layerIndex < _openUI.Length; layerIndex++) { var layer = _openUI[layerIndex]; int count = layer.OrderList.Count; if (count== 0) continue; // 跳过空层级 for (int i = 0; i < count; i++) { if (layer.OrderList.Count != count) { break; } var window = layer.OrderList[i]; window.View.InternalUpdate(); } } } public UIBase ShowUI(UIMetadata meta, params System.Object[] userDatas) { return ShowUIImplSync(meta, userDatas); } public async UniTask ShowUIAsync(UIMetadata meta, params System.Object[] userDatas) { return await ShowUIImplAsync(meta, userDatas); } public void CloseUI(UIMetadata meta, bool force = false) { CloseUIImpl(meta, force); } public UIBase GetUI(UIMetadata meta) { return (UIWindow)GetUIImpl(meta); } void IUIManager.SetTimerManager(ITimerManager timerManager) { _timerManager = timerManager; } } }