public static void onShowPanel(CLPanelBase panel) { if (panel == null) { return; } showingPanels[panel.gameObject.name] = panel; panelCacheQueue.Remove(panel); panelCacheQueue.Insert(0, panel); CLPanelBase bottomPanel = null; if (panelCacheQueue.Count > self.cachePanelSize) { bottomPanel = (panelCacheQueue[panelCacheQueue.Count - 1]) as CLPanelBase; panelCacheQueue.RemoveAt(panelCacheQueue.Count - 1); if (bottomPanel.destroyWhenHide) { if (!bottomPanel.isActive && !CLPanelManager.panelRetainLayer.Contains(bottomPanel)) { //虽然页面是关掉了,但是如果还是在panelRetainLayer里,则不能删除,因为当关掉顶层页面时,这个页面还是会被打开 CLPanelManager.destroyPanel(bottomPanel, false); } } } }
void destroySelf() { if (isActive) { return; } if (!CLPanelManager.panelRetainLayer.Contains(this)) { //虽然页面是关掉了,但是如果还是在panelRetainLayer里,则不能删除,因为当关掉顶层页面时,这个页面还是会被打开 CLPanelManager.destroyPanel(this, false); } }