void Awake() { DontDestroyOnLoad(this); LogManager.InitLogManager(); ClientConfig.InitClientConfig(); //PositionsConfig.InitTerrainConfig(); MapsConfig.InitMapConfig(); }
public static void InitMapConfig() { #if SteamVersion string filePath = GameConfig.PEDataPath + "ConfigFiles"; Directory.CreateDirectory(filePath); filePath += "/MapConfig.xml"; if (File.Exists(filePath)) { using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { XmlSerializer serialize = new XmlSerializer(typeof(MapsConfig)); Self = serialize.Deserialize(fs) as MapsConfig; } } else { using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write)) { XmlSerializer serialize = new XmlSerializer(typeof(MapsConfig)); Self = new MapsConfig(); Self.PatheaMapConfig = new List <MapConfig>(); MapConfig config = new MapConfig(); config.MapName = "PatheaMap"; config.MapDescription = "OH, Come On"; config.GameType = new string[] { "Cooperation", "VS", "Survival" }; config.GameMode = new string[] { "Story", "Adventure", "Build", "Custom" }; config.MapTeamNum = new string[] { "1", "2", "3", "4" }; config.MapCampBalance = new string[] { "yes", "no" }; config.MapAI = new string[] { "yes", "no" }; config.MapTerrainType = new string[] { "Grassland", "Forest", "Desert", "Redstone", "Rainforest", "Mountain", "Swamp", "Crater" }; config.MapWeatherType = new string[] { "Random", "Dry", "Temperate", "Wet" }; Self.PatheaMapConfig.Add(config); serialize.Serialize(fs, Self); } } #endif }
public MapService(MapsConfig config, IImageHelper imageHelper) { this.config = config; this.imageHelper = imageHelper; }