Exemple #1
0
        public void HideView(IUIPanel uiPanel)
        {
            UIPanelData panelData = _uiPanelDatas.Find((uiPanelDataItem) => { return(uiPanelDataItem.UIPanel == uiPanel); });

            panelData.RenderSortOrder = -1;
            panelData.PanelGO.GetComponent <Canvas>().sortingOrder      = panelData.RenderSortOrder;
            panelData.PanelGO.GetComponent <Canvas>().enabled           = false;
            panelData.PanelGO.GetComponent <GraphicRaycaster>().enabled = false;
            uiPanel.OnHide();
        }
Exemple #2
0
        /// <summary>
        /// Pushes the given panel onto the top of the stack, hiding all current panels using
        /// the given transitions
        /// </summary>
        /// <param name="panel">The panel to push</param>
        /// <param name="transition">Type of transition(s) to play</param>
        public void Push(IUIPanel panel, Transition transition)
        {
            Assert.IsNotNull(panel, "UiStack.Push: panel is null");

            // hide top
            if (Count > 0)
            {
                IUIPanel curPanel = Peek();
                curPanel.IsActive = false;
                curPanel.OnHide(BitField.IsFlagSet(transition, Transition.Outro));
            }

            // push new
            m_stack.Push(panel);
            panel.IsActive = true;
            panel.OnPush(BitField.IsFlagSet(transition, Transition.Intro));
        }