public void ShowView(IUIPanel uiPanel, IPlayModule module) { UIPanelData panelData = _uiPanelDatas.Find((uiPanelDataItem) => { return(uiPanelDataItem.UIPanel == uiPanel); }); panelData.RenderSortOrder = _uiPanelDatas.Count; panelData.PanelGO.GetComponent <Canvas>().sortingOrder = panelData.RenderSortOrder; panelData.PanelGO.GetComponent <Canvas>().enabled = true; panelData.PanelGO.GetComponent <GraphicRaycaster>().enabled = true; uiPanel.OnShow(module); }
/// <summary> /// Removes the top panel from the stack, with the given transition(s) /// </summary> /// <param name="transition">Type of transition(s) to play</param> /// <returns>The popped panel</returns> public IUIPanel Pop(Transition transition) { // pop top IUIPanel poppedPanel = m_stack.Pop(); Assert.IsNotNull(poppedPanel, "UIStack.Pop: Top panel is null"); poppedPanel.IsActive = false; poppedPanel.OnPop(BitField.IsFlagSet(transition, Transition.Outro)); // show prev if (Count > 0) { IUIPanel newTop = Peek(); Assert.IsNotNull(poppedPanel, "UIStack.Pop: New top panel is null"); newTop.IsActive = true; newTop.OnShow(BitField.IsFlagSet(transition, Transition.Intro)); } return(poppedPanel); }