Exemple #1
0
    IEnumerator StartLevelWin(string _nextScene, float _endTime, bool _freezeGame)
    {
        won = true;

        //do UI effects

        //freeze game
        float curScale = Time.timeScale;

        if (_freezeGame)
        {
            Time.timeScale = 0;
        }

        //play win music
        if (musicManager)
        {
            musicManager.PlayGameOverWinMusic();
        }

        //wait to load next level
        yield return(new WaitForSecondsRealtime(_endTime));

        Time.timeScale = curScale;

        //load level
        sceneTransData.LoadLevelWithLoadingScreen(_nextScene);
    }
Exemple #2
0
    IEnumerator StartLevelWin(string _nextScene, float _endTime, bool _freezeGame, bool _freezePlayer)
    {
        won = true;

        //do UI effects

        //freeze game
        float curScale = Time.timeScale;

        if (_freezeGame)
        {
            Time.timeScale = 0;
        }

        //freezePlayer
        if (_freezePlayer)
        {
            var cont = spawnedPlayer.GetComponent <UnitController>();
            cont.DisableMovement(true);
            cont.DisableAiming(true);
        }

        //play win music
        if (musicManager)
        {
            musicManager.PlayGameOverWinMusic();
        }

        //wait to load next level
        yield return(new WaitForSecondsRealtime(_endTime));

        Time.timeScale = curScale;

        //load level
        sceneTransData.LoadLevelWithLoadingScreen(_nextScene);
    }
Exemple #3
0
 public void PlayNextScene()
 {
     sceneTrans.LoadLevelWithLoadingScreen(nextSceneToPlay);
 }
Exemple #4
0
 public void LoadLevel()
 {
     lm.LoadLevelWithLoadingScreen(levelToPlay);
 }