protected void OnDestroy() { if (UIMgr.isApplicationQuit) { return; } ClosePage(); int panelID = GetParentPanelID(); if (panelID > 0) { UIMgr.S.uiEventSystem.UnRegister(panelID, OnParentPanelEvent); } BeforDestroy(); if (m_GlobalResLoader != null) { m_GlobalResLoader.Recycle2Cache(); m_GlobalResLoader = null; } m_ParentPage = null; }
private AbstractPage ProcessAttachPage(int panelID, int uiID, GameObject go) { if (go == null) { return(null); } PanelInfo panelInfo = FindPanelInfoByPanelID(panelID); if (panelInfo == null || panelInfo.abstractPanel == null) { Log.e("AttachPage Failed To Find Panel:" + panelID); return(null); } panelInfo.SetSortingOrderDirty(); AbstractPage page = go.GetComponent <AbstractPage>(); if (page == null) { Log.e("Failed To Find Page In UI:" + uiID); go.SetActive(true); SetPanelSortingOrderDirty(); return(null); } UIData panelData = UIDataTable.Get(uiID); if (panelData.panelClassType != null) { if (page.GetType() != panelData.panelClassType) { Log.e("ERROR: Prefab Bind C# Class Is Not Same With Define:" + panelData.name); } } page.parentPage = panelInfo.abstractPanel; page.uiID = uiID; go.SetActive(true); page.OpenPage(); SetPanelSortingOrderDirty(); return(page); }
private void OnPageResLoadSuccess(int uiID, Transform parent, GameObject prefab, bool singleton, Action <AbstractPage> listener) { if (m_NextMaster < 0) { Log.i("PanelInfo Already Close,But Still Call OnPageResLoadSuccess"); return; } if (prefab == null) { Log.e(string.Format("Failed to Attach Page!")); return; } GameObject go = UIMgr.S.InstantiateUIPrefab(prefab); go.SetActive(false); UIMgr.S.InitOpenUIParam(go, parent); AbstractPage page = UIMgr.S.ProcessAttachPage(m_PanelID, uiID, go); if (singleton) { PageWrap wrap = FindPageWrap(uiID); if (wrap == null) { return; } wrap.page = page; } else { if (listener != null) { listener(page); } } }