public class LayerUIManager : Singleton<LayerUIManager> {
private int layerDepth = 50; //UIPanel层级深度
/// <summary>
/// 设置层级深度
/// </summary>
/// <param name="go"></param>
public void SetLayerDepth(GameObject go)
{
layerDepth += 1;
UIPanel[] up = go.GetComponentsInChildren<UIPanel>();
if (up.Length > 0) {
for (int i = 0; i < up.Length; i++)
{
up[i].depth += layerDepth;
}
}
}
}