Exemplo n.º 1
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));
        }