Beispiel #1
0
 public void ClosePanel(bool destory)
 {
     if (m_Panel == null)
     {
         return;
     }
     m_Panel.OnPanelClose(destory);
     if (destory)
     {
         GameObject.Destroy(m_Panel.gameObject);
         m_Panel = null;
     }
     else
     {
         //TODO 改为移动到外部
         m_Panel.gameObject.SetActive(false);
     }
 }
Beispiel #2
0
        public void ClosePanel(AbstractPanel panel)
        {
            if (panel == null)
            {
                return;
            }

            PanelInfo panelInfo = FindPanelInfoByID(panel.panelID);

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

            ClosePanelInfo(panelInfo);
        }