Esempio n. 1
0
        public void LoadResSuccess(GameObject prefab)
        {
            if (prefab == null)
            {
                Log.e("#Failed To Load PanelRes:" + m_PanelID);
                return;
            }

            //默认先挂到hide下面 不触发awake
            GameObject panelGo = GameObject.Instantiate(prefab, UIMgr.S.uiRoot.hideRoot, false);

            panelGo.SetActive(false);
            AbstractPanel panel = panelGo.GetComponent <AbstractPanel>();

            UIMgr.S.InitPanel(panelGo);
            abstractPanel = panel;

            if (panel == null)
            {
                panelGo.SetActive(true);
                Log.e("Not Find Panel Class In Prefab For Panel:" + m_UIID);
                return;
            }
            m_PanelState = ePanelState.Ready;
        }
Esempio n. 2
0
 public void OnCacheReset()
 {
     m_Panel        = null;
     m_PanelState   = ePanelState.UnInit;
     m_PanelID      = -1;
     m_UIID         = -1;
     m_SortingOrder = -1;
     m_OpenCallback = null;
 }
Esempio n. 3
0
        public void ClosePanel(AbstractPanel panel)
        {
            if (panel == null)
            {
                return;
            }

            Destroy(panel.gameObject);
        }
Esempio n. 4
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);
     }
 }
Esempio n. 5
0
        public void HidePanel(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);
                    panel.gameObject.SetActive(false);
                }
                return;
            }
        }
Esempio n. 6
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);
        }