yyl
2025-05-30 d18d4a9dacd9557f2bc0b4cf141e99374406b4dc
Main/UI/UIManager.cs
@@ -123,7 +123,7 @@
        // 初始化各层级的Transform
        staticTrans = uiRoot.Find("Static");
        bottomTrans = uiRoot.Find("Bottom");
        midTrans = uiRoot.Find("Mid");
        midTrans = uiRoot.Find("Middle");
        topTrans = uiRoot.Find("Top");
        systemTrans = uiRoot.Find("System");
@@ -465,6 +465,8 @@
        uiObject.transform.SetParent(parentTrans, false);
        // Debug.LogError("加载UI资源-SetParent " + uiName + " transName is " + parentTrans.gameObject.name);
        // 设置排序顺序
        int baseSortingOrder = GetBaseSortingOrderForLayer(uiBase.uiLayer);
        uiBase.SetSortingOrder(baseSortingOrder);
@@ -522,7 +524,10 @@
    {
        // 获取UI类型名称
        string uiName = typeof(T).Name;
        // Debug.LogError("打开ui " + uiName);
        // 加载UI资源
        T ui = LoadUIResource<T>(uiName);
        if (ui == null)
@@ -531,6 +536,8 @@
            Debug.LogError($"打开UI失败: {uiName}");
            return null;
        }
        // Debug.LogError("加载UI资源 " + uiName);
        
        // 自动设置父级UI(如果未指定且支持父子关系)
        if (parentUI == null && ui.supportParentChildRelation && uiStack.Count > 0)