Example #1
0
        /// <summary>
        /// 把某个页面入栈,  把某个页面显示在界面上
        /// </summary>
        public void PushPanel(UIPanelType panelType)
        {
            if (m_panelStack == null)
            {
                m_panelStack = new Stack <IPanel>();
            }

            //判断一下栈里面是否有页面
            if (m_panelStack.Count > 0)
            {
                IPanel topPanel = m_panelStack.Peek();
                topPanel.OnPause();
            }

            IPanel panel = GetPanel(panelType);

            panel.OnEnter();
            m_panelStack.Push(panel);
        }