Exemple #1
0
    public void RestartGame()
    {
        InstanceManager.Instance._Difficulty = DifficultyManager.Instance._Difficulty;
        InstanceManager.Instance._Level      = GameManager.Instance._Level;
        InstanceManager.Instance.SetLoadingType(true);

        //Load the "loading" scene
        ASyncLoading.Instance.LoadLevel(1);
        ASyncLoading.Instance.ActivateLevel();
        ObjectPooling.DestroyAll();
        //Load the gameplay scene.
        ASyncLoading.Instance.LoadLevel(InstanceManager.Instance._Level.LevelIndex);
        GameManager.Instance.OnUnpause();
    }