public void updateCalcedProperty(TowerTemplate tt) { TowerBase tb = tt.tbase; TowerBattleProperty property = TowerBattleProperty.genTowerBattleProperty(tt); _property.setName(tb.tname); if (tb.atkType == eAtkType.MELLE_AOE || tb.atkType == eAtkType.MELLE_POINT) { string s = "Melee"; _property.setAtkRange(s); } else { string s = string.Format("{0:f1}", property.atkRange * 0.001f); _property.setAtkRange(s); } int atkInteval = tb.towerModel.atkInterval; int actualInteval = (int)(atkInteval / (1.0f + property.atkSpd * 0.01f)); string ss = string.Format("{0:f1}", actualInteval * 0.001f); _property.setAtkSpd(ss, property.atkSpd + ""); _property.setHit(tb.mingzhong); //string s = string s =string.Format("{0:f2}", x); _property.setDamage(property.mainAtk, property.extraAtk); _property.setSkill(property.originSkills); }
public void updateView(TowerTemplate tt) { TowerBattleProperty property = TowerBattleProperty.genTowerBattleProperty(tt); TowerBase tb = tt.tbase; _name.text = tb.tname; _cost1.text = tb.cost [0] + ""; _cost2.text = tb.cost [1] + ""; _cost3.text = tb.cost [2] + ""; if (tb.atkType == eAtkType.MELLE_AOE || tb.atkType == eAtkType.MELLE_POINT) { string s = "Melee"; _range.text = s; } else { string s = getAtkRangeTxt(property.atkRange); _range.text = s; } int atkInteval = tb.towerModel.atkInterval; _spd.text = getAtkSpdTxt(atkInteval); setHit(tb.mingzhong); //setAtkRange(tb.towerModel.atkRange+""); //setAtkSpd(tb.towerModel.atkInterval+""); setDamage(property.mainAtk, property.extraAtk); setSkill(property.originSkills); }