Exemplo n.º 1
0
        public void SwitchScreens(IP_Base_Screen aScreen)
        {
            if (aScreen)
            {
                //Close the current Screen
                if (m_CurrentScreen)
                {
                    m_CurrentScreen.CloseScreen();
                    m_PreviousScreen = m_CurrentScreen;
                }

                //Start the Next Screen
                m_CurrentScreen = aScreen;
                aScreen.gameObject.SetActive(true);
                m_CurrentScreen.StartScreen();
                currentScreenData = m_CurrentScreen.m_ScreenData;


                //Fire the Switched Screen Event
                if (OnSwitchedScreen != null)
                {
                    OnSwitchedScreen.Invoke(currentScreenData);
                }

                HandleBGImage();
            }
        }
Exemplo n.º 2
0
        public void HandleHeader(IP_Base_Screen aScreen)
        {
            if (aScreen)
            {
                //Check to see if we want the Header first
                gameObject.SetActive(aScreen.m_ScreenData.showHeader);
                if (!aScreen.m_ScreenData.showHeader)
                {
                    return;
                }


                //Set the Title
                currentTitle = aScreen.m_ScreenData.screenTitle;
                if (m_TitleText)
                {
                    m_TitleText.text = currentTitle;
                }

                if (m_BackButton)
                {
                    m_BackButton.gameObject.SetActive(aScreen.m_ScreenData.allowBackButton);
                }

                if (m_InfoButton)
                {
                    m_InfoButton.gameObject.SetActive(aScreen.m_ScreenData.showInfoButton);
                }

                if (m_CloseButton)
                {
                    m_CloseButton.gameObject.SetActive(aScreen.m_ScreenData.showCloseButton);
                }

                if (m_MenuButton)
                {
                    m_MenuButton.gameObject.SetActive(aScreen.m_ScreenData.showMenuButton);
                }

                if (m_Logo)
                {
                    m_Logo.gameObject.SetActive(aScreen.m_ScreenData.showLogo);
                }
            }
        }