hch
7 天以前 3661292558b8722bc2f2e54dc33c71f88a97877e
Main/Manager/UIManager.cs
@@ -641,28 +641,16 @@
    private UIBase GetLastSupportParentChildRelationUI()
    {
        List<UIBase> tempList = new List<UIBase>();
        UIBase target = null;
        while (target == null && uiStack.Count > 0)
        foreach (var uiBase in uiStack)
        {
            UIBase uiBase = uiStack.Pop();
            if (uiBase != null && uiBase.supportParentChildRelation && !uiBase.isMainUI)
            if (uiBase != null && uiBase.supportParentChildRelation)
            {
                target = uiBase;
                return uiBase;
            }
            tempList.Add(uiBase);
        }
        for (int i = tempList.Count - 1; i >= 0; i--)
        {
            uiStack.Push(tempList[i]);
        }
        return target;
        return null;
    }
    public UIBase OpenWindow(string uiName, int functionOrder = 0)
@@ -704,8 +692,8 @@
        
        returnValue.gameObject.SetActive(true);
        
        // 自动设置父级UI(如果未指定且支持父子关系)
        if (returnValue.supportParentChildRelation && uiStack.Count > 0)
        // 自动设置父级UI, 如果勾选了ismainui 则不需要找父级UI
        if (returnValue.supportParentChildRelation && uiStack.Count > 0 && !returnValue.isMainUI)
        {
            // 获取栈顶UI
            parentUI = GetLastSupportParentChildRelationUI();