Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (!manager_enabled)
        {
            return;
        }


        if (game_state == 0 && SceneManager.GetActiveScene().name != tutorial1_scene_name)
        {
            SceneManager.LoadScene(tutorial1_scene_name);
            manager_enabled = false;
        }

        if (game_state == 1 && SceneManager.GetActiveScene().name != tutorial2_scene_name)
        {
            SceneManager.LoadScene(tutorial2_scene_name);
            manager_enabled = false;
        }
        if (game_state == 2 && SceneManager.GetActiveScene().name != tutorial3_scene_name)
        {
            SceneManager.LoadScene(tutorial3_scene_name);
            manager_enabled = false;
        }
        if (game_state == 3 && SceneManager.GetActiveScene().name != tutorial4_scene_name)
        {
            SceneManager.LoadScene(tutorial4_scene_name);
            manager_enabled = false;
        }
        if (game_state == 4 && SceneManager.GetActiveScene().name != main_game_scene_name)
        {
            SceneManager.LoadScene(main_game_scene_name);
            manager_enabled = false;
        }

        if (SceneManager.GetActiveScene().name == main_game_scene_name && player_controller != null)
        {
            player_controller.enable_gameplay();
            AudioManager.instance.SetLoop("leveltheme1_v2", true);
            AudioManager.instance.Play("leveltheme1_v2");
            manager_enabled = false;
        }

        if (AudioManager.instance != null)
        {
            AudioManager.instance.SetThemeVolume(game_volume_theme);
            AudioManager.instance.SetThemeVolume(game_volume_SFX);
        }
    }