Example #1
0
        // Update is called once per frame
        void Update()
        {
            if (m_ReadyToFireTask)
            {
                bool canFire = false;

                LoadingModal modal = LoadingModal.s_Instance;
                if (modal != null && modal.readyToTransition)
                {
                    modal.FadeOut();
                    canFire = true;
                }
                else if (modal == null)
                {
                    canFire = true;
                }

                if (canFire)
                {
                    if (m_WaitTask != null)
                    {
                        m_WaitTask();
                        m_WaitTask = null;
                    }

                    m_ReadyToFireTask = false;
                }
            }
        }
Example #2
0
        // Use this for initialization
        void Start()
        {
            LoadingModal modal = LoadingModal.s_Instance;

            if (modal != null)
            {
                modal.FadeOut();
            }

            if (m_QuitButton != null)
            {
                m_QuitButton.SetActive(true);
            }
            else
            {
                Debug.LogError("Missing quitButton from MainMenuUI");
            }

            //Used to return to correct page on return to menu
            switch (s_ReturnPage)
            {
            case MenuPage.Home:
            default:
                ShowDefaultPanel();
                break;

            case MenuPage.Lobby:
                ShowLobbyPanel();
                break;
            }
        }