Exemplo n.º 1
0
    public void ChangeState(GameStates state)
    {
        SetAllObjectsUnactive();

        m_gameState = state;

        if (state == GameStates.Gameplay)
        {
            m_audioManager.PlaySong(m_nextLevel.MusicName);
            m_audioManager.StopSong();
            m_gameplayObject.SetActive(true);
            m_gameplayManager.Init(m_nextLevel);
        }
        else if (state == GameStates.LevelEditor)
        {
            m_levelEditorManager.Init();
            m_levelEditorObject.SetActive(true);
        }
        else if (state == GameStates.LevelSelect)
        {
            m_levelSelectObject.SetActive(true);
            m_levelManager.LoadLevels();
            m_levelSelectManager.Init();
        }
        else if (state == GameStates.Options)
        {
            m_optionsObject.SetActive(true);
            m_optionsManager.Init();
        }
        else if (state == GameStates.MainMenu)
        {
            m_mainMenuObject.SetActive(true);
            m_mainMenuManager.Wait();
        }
        else if (state == GameStates.Tutorial)
        {
            m_tutorialObject.SetActive(true);
            m_tutorialManager.Init();
        }
        else if (state == GameStates.ResultScreen)
        {
            m_resultsScreenObject.SetActive(true);
        }
    }