示例#1
0
    public static void FinishAndSaveLevel(bool allCoins, bool noCoins)
    {
        int      index = SaveAndLoad.GetLastOpenedLevelIndex();
        SaveData save  = SaveAndLoad.LoadLevelData();

        //save.levelCompleted[index] = 1;
        //save.allCoins[index] = allCoins ? 1 : 0;
        //save.noCoins[index] = noCoins ? 1 : 0;
        SaveAndLoad.SaveLevelData(save);
        SaveAndLoad.SetFinishedLevel(true);
        print("SAVED SUCESSFULLY");
    }
 public void Prepare()
 {
     save = SaveAndLoad.LoadLevelData();
     if (SaveAndLoad.GetFinishedLevel())
     {
         SaveAndLoad.SetFinishedLevel(false);
         StartCoroutine(UnlockLevelAnimation());
     }
     else
     {
         currentLevel = 0;
         SetLevelInfo();
         dots.ChangeSelectedLevel(currentLevel);
     }
     SaveAndLoad.SetLastOpenedLevel(currentLevel);
     SaveAndLoad.SetLastOpenedLevelName(levelData[currentLevel].sceneName);
 }