Exemple #1
0
        public void ClosePanel(AbstractPanel panel)
        {
            if (panel == null)
            {
                return;
            }

            PanelInfo panelInfo = FindPanelInfoByPanelID(panel.panelID);

            //该面板的管理失效,直接移除
            if (panelInfo == null)
            {
                panelInfo = GetPanelFromCache(panel.uiID, false);

                if (panelInfo == null)
                {
                    Log.e("Not Find PanelInfo For Panel.");
                    panel.OnPanelClose(true);
                    GameObject.Destroy(panel.gameObject);
                }
                return;
            }

            ClosePanelInfo(panelInfo);
            ReSortPanel();
        }
            public void ClosePanel(bool destroy)
            {
                if (m_Panel == null)
                {
                    return;
                }

                m_Panel.OnPanelClose(destroy);
                if (destroy)
                {
                    GameObject.Destroy(m_Panel.gameObject);
                    m_Panel = null;
                }
                else
                {
                    SetActive(false, false);
                }
            }