public static string GetAttriDetailValueStr(HeroDetailedAttr data, AttrType type) { string result = string.Empty; if (data != null && BattleEquipTools_config.dicAttriDetailShowInfo.ContainsKey(type)) { BattleEquipTools_config.AttriDetailInfo attriDetailInfo = BattleEquipTools_config.dicAttriDetailShowInfo[type]; Type type2 = data.GetType(); FieldInfo field = type2.GetField(attriDetailInfo._baseValue); float num = (float)field.GetValue(data); FieldInfo field2 = type2.GetField(attriDetailInfo._extraValue); float num2 = (float)field2.GetValue(data); result = string.Concat(new string[] { attriDetailInfo._attriName, ":", (num + num2).ToString(attriDetailInfo._format), "(", attriDetailInfo._extraColor, "+", num2.ToString(attriDetailInfo._format), "[-])" }); } return(result); }
public HeroDetailedAttr getDetailedAttr() { HeroDetailedAttr heroDetailedAttr = new HeroDetailedAttr(); heroDetailedAttr.parseFrom(this.data); return(heroDetailedAttr); }
private void LoadHeroAttri() { Units player = MapManager.Instance.GetPlayer(); if (null != player) { this.heroAttr = ((Hero)player).getDetailedAttr(); } }
public static string GetAttriValueStr(HeroDetailedAttr data, AttrType type) { string result = string.Empty; if (data != null && BattleEquipTools_config.dicAttriShowInfo.ContainsKey(type)) { Type type2 = data.GetType(); FieldInfo field = type2.GetField(BattleEquipTools_config.dicAttriShowInfo[type]._baseValue); float num = (float)field.GetValue(data); FieldInfo field2 = type2.GetField(BattleEquipTools_config.dicAttriShowInfo[type]._extraValue); float num2 = (float)field2.GetValue(data); result = BattleEquipTools_config.AttriItemValueColor + (num + num2).ToString(BattleEquipTools_config.dicAttriShowInfo[type]._format); } return(result); }