public static void Load() { Players.Clear(); string filename = "SavedGames" + Path.DirectorySeparatorChar + "Players.json"; if (File.Exists(filename)) { //read contents of file string input; using (StreamReader sr = new StreamReader(filename)) { input = sr.ReadToEnd(); } if (input != null) { //parse contents of file using (JsonTextReader reader = new JsonTextReader(new StringReader(input))) { while (reader.Read()) { if (reader.Value != null) { if (reader.TokenType == JsonToken.PropertyName) { if ((string)reader.Value == "Players") { LoadPlayers(reader); } } } } } } } }
public static void Initialize() { Coroutines.Clear(); }
public static void Initialize() { _Version++; Covers.Clear(); }