public IEnumerator SaveCoroutineMadness(MADNESS_CHECKPOINT check, int time, int collectibles) { DoCheckFileAndCreate(); yield return(null); SaveBlobV2 saveBlob = DoCheckVersionAndRectify(); yield return(null); int index = (int)check; if (time < saveBlob.MadnessTimes[index] || saveBlob.MadnessTimes[index] == -1) { saveBlob.MadnessTimes[index] = time; } if (collectibles > saveBlob.MadnessCollectibles[index]) { saveBlob.MadnessCollectibles[index] = collectibles; } yield return(null); FileStream fileStream = File.Create(savepath); new BinaryFormatter().Serialize(fileStream, saveBlob); yield return(null); fileStream.Close(); yield return(null); }
public IEnumerator CheckIsGameOver(MADNESS_CHECKPOINT check) { DoCheckFileAndCreate(); yield return(null); SaveBlobV2 saveBlob = DoCheckVersionAndRectify(); isGameOver = true; for (int c = 0; c < saveBlob.MadnessTimes.Length; c++) { if (c != (int)check && saveBlob.MadnessTimes[c] == -1) { isGameOver = false; } } if (saveBlob.MadnessTimes[(int)check] != -1) { isGameOver = false; } yield return(null); }