public override void SetTechSettings(TechSettingsDefinition techSettingsDefinition) { foreach (var property in techSettingsDefinition.propertyLevels) { switch (property.Key) { case "isAvailable": { IsStructureAvailable = (property.Value == 1 ? true : false); } break; case "numTilesRadiusExplosion": { switch (property.Value) { case 0: numTilesRadiusExplosion = 1; break; case 1: numTilesRadiusExplosion = 2; break; default: Debug.LogError("SetTechSetting Default Hit"); break; } } break; default: Debug.LogError("SetTechSetting Default Hit"); break; } } }
List <TechSettingsDefinition> GetTechSettingsDefinition(string levelName) { List <TechSettingsDefinition> listOfSettings = new List <TechSettingsDefinition>(); TechSettingsDefinition techSetting; GameManager gm = GameObject.FindObjectOfType <GameManager>(); if (gm == null) { Debug.LogError("Unable to find GameManager object"); } techSetting = new TechSettingsDefinition(Tile.TileType.BOMB); techSetting.propertyLevels.Add("isAvailable", gm.GetTechLevel(Tile.TileType.BOMB)); techSetting.propertyLevels.Add("numTilesRadiusExplosion", 0); listOfSettings.Add(techSetting); techSetting = new TechSettingsDefinition(Tile.TileType.DRILL_RIG); techSetting.propertyLevels.Add("isAvailable", gm.GetTechLevel(Tile.TileType.DRILL_RIG)); techSetting.propertyLevels.Add("numTilesLifetime", 0); listOfSettings.Add(techSetting); techSetting = new TechSettingsDefinition(Tile.TileType.MINERAL_FARM); techSetting.propertyLevels.Add("isAvailable", gm.GetTechLevel(Tile.TileType.MINERAL_FARM)); techSetting.propertyLevels.Add("intervalToFarm", 0); techSetting.propertyLevels.Add("numTileSpawnMax", 0); listOfSettings.Add(techSetting); return(listOfSettings); }
public override void SetTechSettings(TechSettingsDefinition techSettingsDefinition) { foreach (var property in techSettingsDefinition.propertyLevels) { switch (property.Key) { case "isAvailable": { IsStructureAvailable = (property.Value == 1 ? true : false); } break; case "intervalToFarm": { switch (property.Value) { case 0: intervalToFarm = 20; break; case 1: intervalToFarm = 17; break; case 2: intervalToFarm = 14; break; default: Debug.LogError("SetTechSetting Default Hit"); break; } } break; case "numTileSpawnMax": { switch (property.Value) { case 0: numTileSpawnMax = 3; break; case 1: numTileSpawnMax = 4; break; case 2: numTileSpawnMax = 5; break; default: Debug.LogError("SetTechSetting Default Hit"); break; } } break; default: Debug.LogError("SetTechSetting Default Hit"); break; } } }
public virtual void SetTechSettings(TechSettingsDefinition techSettingsDefinition) { }