public static bool Load(string path) { if (path == "") { return(false); } try { XmlSerializer serializer = new XmlSerializer(typeof(SerializebleSettings)); FileStream fs = new FileStream(path, FileMode.Open); SerializebleSettings loaded = (SerializebleSettings)serializer.Deserialize(fs); fs.Close(); MapVertices = loaded.Verts; RocksCoords = loaded.Rocks; MapUVs = loaded.MapUVs; WaterVertices = loaded.Water; WaterUVs = loaded.WaterUVs; WaterHeight = loaded.WaterHeight; } catch (FileNotFoundException ex) { return(false); } return(true); }
public static void Save(string path) { var serSet = new SerializebleSettings(); serSet.Rocks = RocksCoords; serSet.Verts = MapVertices; serSet.MapUVs = MapUVs; serSet.Water = WaterVertices; serSet.WaterUVs = WaterUVs; serSet.WaterHeight = WaterHeight; XmlSerializer serializer = new XmlSerializer(typeof(SerializebleSettings)); FileStream fs = new FileStream(path, FileMode.Create); serializer.Serialize(fs, serSet); fs.Close(); }