Exemplo n.º 1
0
 private void PushPanel2Stack(AbstractPanel panel)
 {
     if (m_PopStack != null && m_PopStack.Count > 0)
     {
         AbstractPanel topPanel = m_PopStack.Peek();
         topPanel.PanelClose();
     }
     m_PopStack.Push(panel);
 }
Exemplo n.º 2
0
        public void ClosePanel(UIID uiID)
        {
            PanelData panelData = null;
            var       data      = UIDataTable.Get(uiID);

            if (data != null)
            {
                panelData = data as PanelData;
            }
            AbstractPanel panel = null;

            if (m_CurrentShowMap.TryGetValue(uiID, out panel))
            {
                if (panel != null && panelData != null)
                {
                    m_CurrentShowMap.Remove(uiID);
                    m_CurrentShowList.Remove(panel);
                    panel.PanelClose();
                    switch (panelData.m_PanelShowMode)
                    {
                    case PanelShowMode.Pop:
                        if (m_PopStack != null && m_PopStack.Count > 0)
                        {
                            m_PopStack.Pop();
                            if (m_PopStack.Count > 0)
                            {
                                AbstractPanel topPanel = m_PopStack.Peek();
                                topPanel.PanelOpen();
                            }
                        }
                        break;

                    case PanelShowMode.HideOther:
                        m_UIRoot.NormalRoot.gameObject.SetActive(true);
                        m_UIRoot.PopRoot.gameObject.SetActive(true);
                        break;
                    }
                }
                else
                {
                    Log.I("Close Panel failed:" + uiID);
                }
            }
        }