示例#1
0
    public void Close(UISystem uiSystem)
    {
        switch (uiSystem.stackLevel)
        {
        case StackLevel.AUTO:     //打开上一个auto界面
            string topUIName = _uiStack.Pop();
            if (topUIName != uiSystem.uiName)
            {
                Debug.LogErrorFormat("<UIMgr> {0}界面不在栈顶,当前栈顶界面为{1}", uiSystem.uiName, topUIName);
                return;
            }
            RemoveStackInfo(topUIName);
            RevertTopUI();
            break;

        case StackLevel.HALF:      //将half界面从Auto界面中移除掉
            topUIName = _uiStack.Peek();
            UIStackInfo info = _stackInfoDic[topUIName];
            info.RemoveHalfUI(_UIListByName[topUIName].stackIndex, uiSystem.uiName);
            RemoveStackInfo(uiSystem.uiName);
            break;

        case StackLevel.Manual:
            break;
        }

        OnClose(uiSystem);
    }
示例#2
0
    private void RemoveUIOnBackup(string uiName, bool isRecordIndex)
    {
        UISystem    uiSystem = _UIListByName[uiName];
        UIStackInfo info     = _stackInfoDic[uiName];

        switch (uiSystem.stackLevel)
        {
        case StackLevel.AUTO:
            int index;
            if (isRecordIndex)
            {
                index = info.indexStack.Pop();
            }
            else
            {
                index = uiSystem.stackIndex;
            }
            RemoveStackInfo(uiName);
            //移除该Index下的half界面
            List <string> halfList;
            if (info.halfDicByIndex.TryGetValue(index, out halfList))
            {
                for (int i = 0; i < halfList.Count; i++)
                {
                    RemoveUIOnBackup(halfList[i], isRecordIndex);
                }
                info.halfDicByIndex.Remove(index);
            }
            break;

        case StackLevel.HALF:
            if (isRecordIndex)
            {
                info.indexStack.Pop();     //移除index
            }
            RemoveStackInfo(uiName);
            break;
        }
    }