Exemplo n.º 1
0
    private IEnumerator ChangeSceneWithDelay()
    {
        NotifyObservers(IGameManagerObserver.ChooseEvent.changeScene);
        Scene currentScene = SceneManager.GetActiveScene();

        if (currentScene.buildIndex == 0)
        {
            Animator officeAnimator = GameObject.Find("OfficeLevel").GetComponent <Animator>();
            officeAnimator.enabled = true;
            yield return(new WaitForSeconds(5));

            SceneManager.LoadScene(1);
            _isGameStarted = true;
            StartCoroutine("ShowBannerWithDelay");
        }
        else
        {
            Pause();
            _score         = 0;
            _isGameStarted = false;
            StopCoroutine("ShowBannerWithDelay");
            _adsController.HideBannerAd();
            SceneManager.LoadScene(0);
        }
    }