Ejemplo n.º 1
0
    IEnumerator CoPlayGame()
    {
        Time.timeScale = 1f;
        cinematicManager.btnSkip.enabled      = false;
        cinematicManager.btnBeginPlay.enabled = false;
        cinematicManager.btnGoToTitle.enabled = false;

        Tweener tween = FadeHelper.FadeIn(imgBlackBoard, 1f);

        yield return(new WaitWhile(() => tween.IsPlaying()));

        cinematicManager.HidePrologue();
        audioSource.DOFade(0f, 1f);
        yield return(new WaitForSeconds(1f));

        audioSource.Stop();
        audioSource.volume = 1f;
        Camera.main.GetComponent <AudioListener>().enabled = false;
        yield return(SceneManager.LoadSceneAsync("GameScene", LoadSceneMode.Additive));

        yield return(SceneManager.UnloadSceneAsync("TitleScene"));

        yield return(SceneManager.UnloadSceneAsync("CinematicScene"));

        FadeHelper.FadeOut(imgBlackBoard, 1f);
        gameState = eGameState.playingGame;
    }