public void AddBuildingConf(BuildingConf conf) { // Debug.LogError ("conf.id" + conf.id); if (buildingConfs.ContainsKey(conf.id)) { return; } buildingConfs.Add(conf.id, conf); }
public override void Start() { base.Start(); BuildingConf conf = BuildingConfManager.Instance.GetConfByID(10102); if (conf != null) { data.life = conf.life; data.maxlife = conf.life; } }
private static void Deserialize(byte[] bytes) { int startIndex = 0; while (startIndex < bytes.Length) { var conf = new BuildingConf(); conf.Desearize(bytes, ref startIndex); Configs.Add(conf.Id, conf); } }
public override void Start() { int classType = data.classtype; base.Start(); BuildingConf conf = BuildingConfManager.Instance.GetBuildingConfById(10102); if (conf != null) { data.life = conf.life; data.maxlife = conf.life; } }
public override void Start() { base.Start(); BuildingConf conf = BuildingConfManager.Instance.GetBuildingConfById(10111); if (conf != null) { data.life = 20; //conf.life; data.maxlife = 20; //conf.life; data.attackRange = conf.attackRange[1]; data.searchInterval = 0.1f; data.attackInterval = 1.0f; data.attackPower = conf.attack[1]; } }
private void ReadBuilding(CsvReader cr) { int fieldCount = cr.FieldCount; string [] headers = cr.GetFieldHeaders(); //cr.ReadNextRecord ();// the real head while (cr.ReadNextRecord()) { int i = 0; BuildingConf conf = new BuildingConf(); conf.id = int.Parse(cr[i++]); conf.name = cr[i++]; conf.type = int.Parse(cr[i++]); string[] buildRange = cr[i++].Split(';'); conf.buildRange[0] = int.Parse(buildRange[0]); conf.buildRange[1] = int.Parse(buildRange[1]); conf.life = int.Parse(cr[i++]); conf.hitRate = int.Parse(empty2number(cr[i++])); conf.attackSpeed = float.Parse(empty2number(cr[i++])); string[] attack = cr[i++].Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries); if (attack.Length != 0) { conf.attack[0] = int.Parse(attack[0]); conf.attack[1] = int.Parse(attack[1]); } string[] attackRange = cr[i++].Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries); if (attackRange.Length != 0) { conf.attackRange[0] = float.Parse(attackRange[0]); conf.attackRange[1] = float.Parse(attackRange[1]); } conf.attackMode = int.Parse(empty2number(cr[i++])); conf.damageRange = float.Parse(empty2number(cr[i++])); conf.cooldownHit = int.Parse(empty2number(cr[i++])); conf.cooldownTime = float.Parse(empty2number(cr[i++])); conf.buffId = int.Parse(empty2number(cr[i++])); conf.level = int.Parse(empty2number(cr[i++])); conf.desc = cr[i++]; conf.atlas = cr[i++]; BuildingConfManager.Instance.AddBuildingConf(conf); } //BuildingConfManager.Instance.GetBuildingConfById (0); }
public override string GetResPath() { var conf = BuildingConf.Get(BuildingId); return(conf.ResPath); }
private void InitConfig() { ArmyConf.Init(); BuildingConf.Init(); }