public UIScreenBase SetTransitionScreen(UIScreenType screenType, UIScreenArgs args)
        {
            if (m_transitionScreen != null)
            {
                m_transitionScreen.ReleaseResources();

                m_transitionScreen.transform.parent = null;
                m_transitionScreen.gameObject.SetActive(false);
                GameObject.Destroy(m_transitionScreen.gameObject);
            }

            if (screenType == UIScreenType.None)
            {
                m_transitionScreen = null;
                return(null);
            }

            m_transitionScreen = LoadScreen(screenType) as UIScreenBase;
            if (m_transitionScreen == null)
            {
                return(null);
            }

            IncrementScreenPanelDepth(m_transitionScreen, m_transitionPanelDepth);

            m_transitionScreen.Initialize(args);

            return(m_transitionScreen);
        }
        public UIScreenBase SetHUD(UIScreenType screenType, UIScreenArgs args)
        {
            if (m_hud != null)
            {
                m_hud.ReleaseResources();

                m_hud.transform.parent = null;
                m_hud.gameObject.SetActive(false);
                GameObject.Destroy(m_hud.gameObject);
            }

            if (screenType == UIScreenType.None)
            {
                m_hud = null;
                return(null);
            }

            m_hud = LoadScreen(screenType);
            if (m_hud == null)
            {
                return(null);
            }

            m_hud.Initialize(args);
            return(m_hud);
        }
        public void PopScreen()
        {
            if (m_screenStack.Count == 0)
            {
                return;
            }

            UIScreenBase old = m_screenStack.Peek();

            m_screenStack.Pop();

            old.ReleaseResources();

            old.transform.SetParent(null);
            GameObject.Destroy(old.gameObject);
        }