Ejemplo n.º 1
0
    public bool CloseUI(string name)
    {
        UIBase ui;

        if (m_openedDic.TryGetValue(name, out ui))
        {
            OnCloseUI(ui);

            for (int i = 0; i < m_recoverList.Count; i++)
            {
                UIContext uiContext = m_recoverList[i];
                if (uiContext.uiName == ui.uiContext.uiName)
                {
                    m_recoverList.Remove(uiContext);
                    break;
                }
            }

            if (ui.uiContext.uiType == UIType.FULL)
            {
                List <UIContext> openList = new List <UIContext>();
                for (int i = 0; i < m_recoverList.Count; i++)
                {
                    UIContext uiContext = m_recoverList[i];
                    if (uiContext.CanRecover() && uiContext.uiName != ui.uiContext.uiName)
                    {
                        openList.Insert(0, uiContext);
                        if (uiContext.uiType == UIType.FULL)
                        {
                            break;
                        }
                    }
                }
                for (int i = 0; i < openList.Count; i++)
                {
                    OpenUI(openList[i].uiName);
                }
            }

            return(true);
        }
        return(false);
    }