2023-12-08 18:41:26 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class UIManager
|
|
|
|
|
|
{
|
2025-04-08 14:54:25 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 动静分离,Canvas分层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum ECanvasRoot
|
|
|
|
|
|
{
|
|
|
|
|
|
Dynamic0,
|
|
|
|
|
|
Static1,
|
|
|
|
|
|
Dynamic2,
|
|
|
|
|
|
Static3,
|
|
|
|
|
|
Dynamic4
|
|
|
|
|
|
}
|
2023-12-08 18:41:26 +08:00
|
|
|
|
private LinkedList<UIWindow> _GetLayerWindowList(UIWindowLayer layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
LinkedList<UIWindow> windowsL = new LinkedList<UIWindow>();
|
|
|
|
|
|
foreach (var windowData in _layerList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (windowData.Key == (int)layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
windowsL = windowData.Value;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return windowsL;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool _CheckIsLayerListEmpty(UIWindowLayer enumType)
|
|
|
|
|
|
{
|
|
|
|
|
|
var normalWindowList = _GetLayerWindowList(enumType);
|
|
|
|
|
|
if (normalWindowList.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CheckIsLayerListEmpty(UIWindowLayer enumType)
|
|
|
|
|
|
{
|
|
|
|
|
|
return _CheckIsLayerListEmpty(enumType);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public UIWindow GetTopWindowInLayer(UIWindowLayer windowType)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_layerList.TryGetValue((int)windowType, out var windowList))
|
|
|
|
|
|
{
|
2023-12-14 14:47:14 +08:00
|
|
|
|
if (windowList.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
UIWindow window = windowList.Last.Value;
|
|
|
|
|
|
return window;
|
|
|
|
|
|
}
|
2023-12-08 18:41:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|