Пример #1
0
        void ExtractStoredScore()
        {
            if (GameSaveManager.hasExtractedScore)
            {
                return;
            }

            m_ProgressConfig.TRexScore       += GameSaveManager.StoredTRexScore;
            m_ProgressConfig.StegosaursScore += GameSaveManager.StoredStegosaursScore;
            m_ProgressConfig.PterosaursScore += GameSaveManager.StoredPterosaursScore;
            m_ProgressConfig.FailureCount    += GameSaveManager.StoredFailureCount;
            GameSaveManager.ClearStoredScore();
        }
Пример #2
0
        void Update()
        {
            GameStateManager.GameState GAME_STATE = GameStateManager.STATE;

            //Always be able to reset
            if (Input.GetKey(KeyCode.Alpha1) && Input.GetKey(KeyCode.Alpha9))
            {
                GAME_STATE = GameStateManager.GameState.Reset;
                m_ProgressConfig.m_CurrentProgress = 0;
                m_ProgressConfig.FailureCount      = 0;
                m_ProgressConfig.TRexScore         = 0;
                m_ProgressConfig.StegosaursScore   = 0;
                m_ProgressConfig.PterosaursScore   = 0;
                GameSaveManager.ClearStoredScore();
                GameStateManager.SetCurrentState(GameStateManager.GameState.MailReading);

                SceneManager.LoadScene(firstSceneName);
            }
        }
Пример #3
0
        private void Update()
        {
            //Get the game state
            GameStateManager.GameState GAME_STATE = GameStateManager.STATE;

            //Always be able to reset
            if (Input.GetKey(KeyCode.Alpha1) && Input.GetKey(KeyCode.Alpha9))
            {
                GAME_STATE = GameStateManager.GameState.Reset;
            }

            //Handle each game state
            switch (GAME_STATE)
            {
            case GameStateManager.GameState.Reset:

                EmailProgressNum = 0;
                m_ProgressConfig.m_CurrentProgress = EmailProgressNum;
                m_ProgressConfig.FailureCount      = 0;
                m_ProgressConfig.TRexScore         = 0;
                m_ProgressConfig.StegosaursScore   = 0;
                m_ProgressConfig.PterosaursScore   = 0;
                GameSaveManager.ClearStoredScore();


                GameStateManager.SetCurrentState(GameStateManager.GameState.MailReading);

                SceneManager.LoadScene(firstSceneName);

                break;

            case GameStateManager.GameState.MailReading:
                if (!stateInited)
                {
                    EmailProgressNum = m_ProgressConfig.m_CurrentProgress;
                    ExtractStoredScore();
                    EnableProceedToWork(false);
                    ShowCurrentMail();
                    stateInited = true;
                }

                if (m_EmailManager.isEmailClosed)
                {
                    EnableProceedToWork(true);
                }

                break;

            case GameStateManager.GameState.SavingProgress:
                if (!stateInited)
                {
                    EmailProgressNum++;
                    m_ProgressConfig.m_CurrentProgress = EmailProgressNum;
                    m_ProgressConfig.SetDirty();
                    stateInited = true;
                }
                break;

            case GameStateManager.GameState.Gaming:
                if (!stateInited)
                {
                    //EmailProgressNum++;
                    stateInited = true;
                }
                break;

            case GameStateManager.GameState.Restarting:

                SceneManager.LoadScene("MainFrame");
                GameStateManager.SetCurrentState(GameStateManager.GameState.Reset);
                break;

            case GameStateManager.GameState.Ending:
                break;

            default:
                break;
            }
        }