public static void Serialize(ConfigData config) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(ConfigData)); using (StreamWriter streamWriter = new StreamWriter(ConfigData.GetConfigPath())) { xmlSerializer.Serialize(streamWriter, config); } }
public InGameTerrainTool() { Debug.Log(ConfigData.GetConfigPath()); if (File.Exists(ConfigData.GetConfigPath())) { Config = ConfigData.Deserialize(); } else { Config = new ConfigData(); ConfigData.Serialize(Config); } if (InGameTerrainTool.Config != null) { //this.m_costMultiplier = InGameTerrainTool.Config.MoneyModifer; this.m_free = InGameTerrainTool.Config.Free; } }