#pragma warning restore 0649 public static IEnumerable <Biome> Load(string filename) { string jsonStr = File.ReadAllText(filename); BiomeLoader loader = JsonUtility.FromJson <BiomeLoader>(jsonStr); for (int i = 0; i < loader.biomes.Length; i++) { yield return(CreateBiome(loader.biomes[i])); } }
public static void LoadBiomesFile(string filename) { foreach (Biome biome in BiomeLoader.Load(filename)) { if (Biomes.ContainsKey(biome.Id)) { Biomes[biome.Id] = biome; } else { Biomes.Add(biome.Id, biome); } if (biome.TerrainType == BiomeTerrainType.Ice) { MaxLoadedIceBiomeTemperature = Mathf.Max(biome.MaxTemperature, MaxLoadedIceBiomeTemperature); MinLoadedIceBiomeTemperature = Mathf.Min(biome.MinTemperature, MinLoadedIceBiomeTemperature); MaxLoadedIceBiomeRainfall = Mathf.Max(biome.MaxRainfall, MaxLoadedIceBiomeRainfall); MinLoadedIceBiomeRainfall = Mathf.Min(biome.MinRainfall, MinLoadedIceBiomeRainfall); MaxLoadedIceBiomeAltitude = Mathf.Max(biome.MaxAltitude, MaxLoadedIceBiomeAltitude); MinLoadedIceBiomeAltitude = Mathf.Min(biome.MinAltitude, MinLoadedIceBiomeAltitude); } } }
public override void ResetNearbyTileEffects() => BiomeLoader.ActionOnAllBiomes(b => b.TileCount = 0);
public override void TileCountsAvailable(int[] tileCounts) { BiomeLoader.ActionOnAllBiomes(b => b.CountBiomeTiles(tileCounts)); }