Exemplo n.º 1
0
    private IEnumerator RestartGame()
    {
        health.ResetHealth(true);
        currentHealth = 3;
        SetHasSword(false);
        SetIsArmored(false);
        illuminate.SetHasBackupTorch(false);
        ResetCoins();
        //SceneManager.LoadScene(0); // Instead of loading the first scene, switching to loading a random scene starting the game over.
        sceneRandomizer.InitializeSceneList();
        SceneManager.LoadScene(sceneRandomizer.GetRandomSceneIndex());
        yield return(null);

        coinMultiplier = coinMultiplierBase;
        PlaySound(startSound);
        GetPlayer();
        illuminate.ResetFuel();
        illuminate.SetDisabled(false);
    }