private static void FirstTimeSetup() { foreach (AbstractTile tile in grid) { if (tile is AbstractBuildingTile buildingTile) { buildingTile.SetSoilType(SoilType.Sand); buildingTile.SetFoundationType(FoundationType.Wooden_Poles); buildingTile.SetBuildingType(BuildingType.House); buildingTile.SpawnBuilding(false); BuildingHealth buildingHealth = buildingTile.Building.GetComponent <BuildingHealth>(); buildingHealth.DamageFoundation(buildingHealth.CurrentFoundationHealth * 0.80f); buildingHealth.DamageSoil(buildingHealth.CurrentSoilHealth * 0.75f); return; } } }
private void DecreaseHealth(WeatherEventData data) { health.DamageBuilding(data.BuildingTime); health.DamageFoundation(data.FoundationTime); health.DamageSoil(data.SoilTime); }