Ejemplo n.º 1
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);
                }
            }
        }
Ejemplo n.º 2
0
        public void OpenPanelTop(UIID uiID, params object[] args)
        {
            AbstractPanel panel = null;

            if (!m_AllPanelMap.TryGetValue(uiID, out panel))
            {
                panel = GetPanel(uiID);
                panel.PanelInit();
                if (panel == null)
                {
                    Log.I("No find panel:{0}", uiID.ToString());
                    return;
                }
            }
            panel.transform.SetParent(m_UIRoot.TopRoot);

            if (!m_CurrentShowMap.ContainsValue(panel))
            {
                m_CurrentShowMap.Add(uiID, panel);
            }
            m_CurrentShowList.Add(panel);
            panel.PanelOpen(args);
        }
Ejemplo n.º 3
0
        public void OpenPanel(UIID uiID, params object[] args)
        {
            AbstractPanel panel = null;

            if (!m_AllPanelMap.TryGetValue(uiID, out panel))
            {
                panel = GetPanel(uiID);
                panel.PanelInit();
                if (panel == null)
                {
                    Log.I("No find panel:{0}", uiID.ToString());
                    return;
                }
            }
            panel.SortIndex = m_UIRoot.RequireNextPanelSortingOrder(panel.ShowMode);
            AdjustSiblingIndex(panel);
            if (!m_CurrentShowMap.ContainsValue(panel))
            {
                m_CurrentShowMap.Add(uiID, panel);
            }
            m_CurrentShowList.Add(panel);
            panel.PanelOpen(args);
        }