Пример #1
0
        public void SwitchToSection(InGameMenuSection section)
        {
            if (sectionStack.Count > 0)
            {
                sectionStack.Peek().OnHide();
            }

            sectionStack.Push(section);
            section.OnShow(this);
        }
Пример #2
0
        public void LeaveSection(InGameMenuSection section)
        {
            if (sectionStack.Count > 0)
            {
                InGameMenuSection activeSection = sectionStack.Pop();
                if (activeSection != section)
                {
                    throw new InvalidOperationException();
                }

                activeSection.OnHide();

                if (sectionStack.Count > 0)
                {
                    sectionStack.Peek().OnShow(this);
                }
            }
        }