Beispiel #1
0
        public virtual void PopScreen()
        {
            if (m_ScreenStack.Count == 0)
            {
                Logger.LogWarning(this, "Stack empty when pop called");
                return;
            }
            ScreenInfo    screenInfo       = m_ScreenStack.Pop();
            UIControlBase screenController = screenInfo.screenController;

            Logger.LogInfo(this, "Popping " + screenController.name);
            if (m_ScreenStack.Count > 0)
            {
                UIControlBase uIControlBase = screenController;
                ScreenInfo    screenInfo2   = m_ScreenStack.Peek();
                if (screenInfo2.screenController != null)
                {
                    screenInfo2.screenController.OnPoppedToTop(uIControlBase.ScreenName);
                }
                ScreenInfo screenInfo3 = null;
                foreach (ScreenInfo item in m_ScreenStack)
                {
                    if (item.showDarkBG)
                    {
                        screenInfo3 = item;
                        break;
                    }
                }
                if (screenInfo3 != null)
                {
                    ShowDarkMask(screenInfo3);
                }
                else
                {
                    HideDarkMask();
                }
            }
            else
            {
                HideDarkMask();
            }
            if (screenInfo.popCallback != null)
            {
                screenInfo.popCallback(screenInfo.screenController);
            }
            screenController.UnloadUI();
            Object.Destroy(screenController.gameObject);
        }