예제 #1
0
    public void NewGame()
    {
        PlayerPrefs.SetInt("maxLevel", 1);
        PlayerPrefs.SetInt("hasViewedInstructions", 0);
        PlayerPrefs.SetInt("hasViewedBounceInstructions", 0);
        PlayerPrefs.SetInt("hasViewedNoDrawInstructions", 0);
        PlayerPrefs.SetInt("TotalStars", 0);
        for (int i = 1; i < SceneManager.sceneCountInBuildSettings - 1; i++)
        {
            string key = "Hole" + i + "Stars";
            PlayerPrefs.SetInt(key, 0);
        }
        // Reset all customization
        for (int j = 0; j < ballCustom.transform.childCount; j++)
        {
            string key = ballCustom.transform.GetChild(j).name + "BuyState";
            PlayerPrefs.SetInt(key, 0);
        }
        for (int k = 0; k < trailCustom.transform.childCount; k++)
        {
            string key = trailCustom.transform.GetChild(k).name + "BuyState";
            PlayerPrefs.SetInt(key, 0);
        }
        // Reset ball customization to white
        PlayerPrefs.SetString("CurrentBall", "White");
        PlayerPrefs.SetInt("Trail", -1);
        PlayerPrefs.SetInt("Ball", 0);
        customizationManager.UpdateCurrentBall(0);
        customizationManager.ResetTrail();


        maxLevelUnlocked = 1;
        LoadLevel(0);
    }