public void LoadSavables() { foreach (string s in currentWorld.savables) { if (Savable.GetRealm(s) == currentWorld.realm) { Savable.Deserialize(s); } } }
public static void SaveWorld(World world) { for (int i = 0; i < world.savables.Count; i++) { string s = world.savables[i]; if (Savable.GetRealm(s) == world.realm) { world.savables.Remove(s); } } Savable[] savables = FindObjectsOfType <Savable>(); foreach (Savable s in savables) { world.savables.Add(s.Serialize()); } SaveObject(world.name.ToLower(), world, "Worlds"); print(savables.Length + " savables found"); print("Saved world: " + world.name); }