/// <summary> /// 设置属性信息 /// </summary> public void SetPropInfo() { strong_info = EquipStrongConfig.GetEquipStrongInfo(cur_equip_info.star, cur_strong_lv); if (strong_info == null) { return; } panel.goldtext.text = strong_info.cost.ToString(); List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(1, cur_equip_info.id, cur_star, cur_strong_lv); for (int i = 0; i < prop_list.Count; i++) { EquipAddInfo info = prop_list[i]; string prop_name_label = string.Format("prop_name_{0}", i.ToString()); UILabel prop_name = UtilTools.GetChild <UILabel>(panel.prop_info, prop_name_label); prop_name.text = TextManager.GetUIString(info.prop_name); string cur_prop_txt_label = string.Format("cur_prop_value_{0}", i.ToString()); UILabel cur_prop_txt = UtilTools.GetChild <UILabel>(panel.prop_info, cur_prop_txt_label); cur_prop_txt.text = (info.prop_base_value + info.prop_strong_value + info.prop_star_value).ToString(); string next_prop_txt_label = string.Format("next_prop_value_{0}", i.ToString()); UILabel next_prop_txt = UtilTools.GetChild <UILabel>(panel.prop_info, next_prop_txt_label); next_prop_txt.text = (info.prop_base_value + info.prop_next_strong_value + info.prop_next_star_value).ToString(); } }
private void SetInherit() { panel.goldtext.text = GetNeedEuro() + ""; UISprite[] star_obj = UtilTools.GetChilds <UISprite>(panel.select_equip, "star"); UtilTools.SetStar(select_equip_data.star, star_obj); UISprite color = UtilTools.GetChild <UISprite>(panel.select_equip, "color"); color.spriteName = "color" + select_equip_data.star; UITexture icon = UtilTools.GetChild <UITexture>(panel.select_equip, "icon"); LoadSprite.LoaderItem(icon, select_equip_data.itemID, false); next_strong_lv = select_equip_data.strongLevel - 10; strong_info = EquipStrongConfig.GetEquipStrongInfo(cur_equip_info.star, next_strong_lv); if (strong_info == null) { return; } UILabel next_strong_txt = UtilTools.GetChild <UILabel>(panel.prop_info, "next_strong_lv"); next_strong_txt.text = "Lv." + next_strong_lv.ToString(); List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(-1, int.Parse(select_equip_data.itemID), cur_star, next_strong_lv); for (int i = 0; i < prop_list.Count; i++) { EquipAddInfo info = prop_list[i]; string next_prop_txt_label = string.Format("next_prop_value_{0}", i.ToString()); UILabel next_prop_txt = UtilTools.GetChild <UILabel>(panel.prop_info, next_prop_txt_label); next_prop_txt.text = (info.prop_base_value + info.prop_next_strong_value + info.prop_next_star_value).ToString(); } }
/// <summary> /// 获取属性增加数据 /// type ==0 升星 ,==1 升级, ==-1 装备当前属性值 /// </summary> /// <returns></returns> public static List <EquipAddInfo> GetPropAddDataListByID(int type, int equip_id, int star, int strong) { EquipAddInfo info = null; string[] prop_arr = Define.EquipPropStr.Split(','); EquipInfo equip_info = GetEquipInfo(equip_id); int next_star_num = star; int next_strong_lv = strong; if (type == 0) { next_star_num = star == equip_info.maxStar ? equip_info.maxStar : star + 1; } if (type == 1) { next_strong_lv = strong >= equip_info.maxStrongLevel ? equip_info.maxStrongLevel : strong + 1; } List <EquipAddInfo> list = new List <EquipAddInfo>(); for (int i = 0; i < prop_arr.Length; i++) { info = new EquipAddInfo(); string prop_str = prop_arr[i]; int prop_value = equip_info == null ? 0 : GameConvert.IntConvert(equip_info.GetType().GetField(prop_str).GetValue(equip_info)); if (prop_value == 0) { continue; } // 获取星级属性 EquipStar star_info = EquipStarConfig.GetEquipStarInfo(equip_id, star); int prop_star_value = star_info == null ? 0 : GameConvert.IntConvert(star_info.GetType().GetField(prop_str).GetValue(star_info)); EquipStar star_next_info = EquipStarConfig.GetEquipStarInfo(equip_id, next_star_num); int prop_next_star_value = star_next_info == null ? 0 : GameConvert.IntConvert(star_next_info.GetType().GetField(prop_str).GetValue(star_next_info)); //获取强化 int prop_strong_value = 0; int next_prop_star_value = 0; EquipStrong strong_info = EquipStrongConfig.GetEquipStrongInfo(equip_info.star, strong); EquipStrong next_strong_info = EquipStrongConfig.GetEquipStrongInfo(equip_info.star, next_strong_lv); if (strong_info != null) { prop_strong_value = GameConvert.IntConvert(strong_info.GetType().GetField(prop_str).GetValue(strong_info)); } if (next_strong_info != null) { next_prop_star_value = GameConvert.IntConvert(next_strong_info.GetType().GetField(prop_str).GetValue(next_strong_info)); } info.prop_name = prop_str; info.prop_base_value = prop_value; info.prop_star_value = prop_star_value; info.prop_next_star_value = prop_next_star_value; info.prop_strong_value = prop_strong_value; info.prop_next_strong_value = next_prop_star_value; list.Add(info); } return(list); }