61 lines
1.4 KiB
C#
61 lines
1.4 KiB
C#
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
public partial class UIManager
|
||
{
|
||
/// <summary>
|
||
/// 动静分离,Canvas分层
|
||
/// </summary>
|
||
public enum ECanvasRoot
|
||
{
|
||
Dynamic0,
|
||
Static1,
|
||
Dynamic2,
|
||
Static3,
|
||
Dynamic4
|
||
}
|
||
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))
|
||
{
|
||
if (windowList.Count > 0)
|
||
{
|
||
UIWindow window = windowList.Last.Value;
|
||
return window;
|
||
}
|
||
}
|
||
|
||
return null;
|
||
}
|
||
} |