private void SetEnchantmentAttrs(int typeId) { List <string> list = new List <string>(); FuMoDaoJuShuXing fuMoDaoJuShuXing = DataReader <FuMoDaoJuShuXing> .Get(typeId); string[] array = fuMoDaoJuShuXing.describe.Split(new char[] { ';' }); string text = AttrUtility.GetAttrName(fuMoDaoJuShuXing.runeAttr) + " " + string.Format(string.Concat(new string[] { "<color=#ff7d4b>", array[0], " - ", array[1], "</color>" }), new object[0]) + string.Empty; list.Add(text); for (int i = 0; i < 4; i++) { Text component = base.FindTransform("texAttr" + i).GetComponent <Text>(); component.get_gameObject().SetActive(false); } int num = 0; while (num < list.get_Count() && num < 4) { Text component2 = base.FindTransform("texAttr" + num).GetComponent <Text>(); component2.get_gameObject().SetActive(true); component2.set_text(list.get_Item(num)); num++; } }
private void SetEnchantmentData(List <ExcellentAttr> enchantAttrs) { if (enchantAttrs == null || enchantAttrs.get_Count() <= 0) { this.EnchantmentAttr.get_gameObject().SetActive(false); return; } this.EnchantmentAttr.get_gameObject().SetActive(true); int i = 0; bool flag = false; int num = 0; while (i < enchantAttrs.get_Count()) { if (i >= 3) { break; } if (enchantAttrs.get_Item(i).attrId > 0) { flag = true; int attrId = enchantAttrs.get_Item(i).attrId; Items items = DataReader <Items> .Get(attrId); string text = string.Empty; if (items != null) { text = GameDataUtils.GetChineseContent(items.name, false); } FuMoDaoJuShuXing fuMoDaoJuShuXing = DataReader <FuMoDaoJuShuXing> .Get(attrId); this.EnchantmentAttr.FindChild("EquipItem2Text" + i).get_gameObject().SetActive(true); string text2 = string.Empty; if (fuMoDaoJuShuXing != null) { if (fuMoDaoJuShuXing.valueType == 0) { text2 = string.Concat(new object[] { AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr), " +", (float)(enchantAttrs.get_Item(i).value * 100L) / 1000f, "%" }); } else { text2 = AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr) + " +" + enchantAttrs.get_Item(i).value; } this.EnchantmentAttr.FindChild("EquipItem2Text" + i).FindChild("Item2Text").GetComponent <Text>().set_text(string.Format(text + ": <color=#ff7d4b>{0}</color>", text2)); num++; } } i++; } if (!flag) { this.EnchantmentAttr.get_gameObject().SetActive(false); } else { for (int j = num; j < 3; j++) { this.EnchantmentAttr.FindChild("EquipItem2Text" + j).get_gameObject().SetActive(false); } } }
public void OnEnchantmentEquipRes(ExcellentAttr oldExcellentAttr, ExcellentAttr newExcellentAttr) { EquipLib equipLib = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == (EquipLibType.ELT) this.CurrentPos); string text = "原属性:"; if (oldExcellentAttr == null) { text = "未附魔"; } else if (oldExcellentAttr.attrId > 0) { FuMoDaoJuShuXing fuMoDaoJuShuXing = DataReader <FuMoDaoJuShuXing> .Get(oldExcellentAttr.attrId); if (fuMoDaoJuShuXing.valueType == 0) { string text2 = text; text = string.Concat(new object[] { text2, AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr), " +", (float)(oldExcellentAttr.value * 100L) / 1000f, "%" }); } else { string text2 = text; text = string.Concat(new object[] { text2, AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr), " +", oldExcellentAttr.value }); } } else { text = "未附魔"; } string text3 = string.Empty; if (newExcellentAttr != null) { FuMoDaoJuShuXing fuMoDaoJuShuXing2 = DataReader <FuMoDaoJuShuXing> .Get(newExcellentAttr.attrId); if (fuMoDaoJuShuXing2 != null) { text3 += "新属性:"; if (fuMoDaoJuShuXing2.valueType == 0) { string text2 = text3; text3 = string.Concat(new object[] { text2, AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing2.runeAttr), " +", (float)(newExcellentAttr.value * 100L) / 1000f, "%" }); } else { string text2 = text3; text3 = string.Concat(new object[] { text2, AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing2.runeAttr), " +", newExcellentAttr.value }); } } } DialogEnchantmentUI dialogEnchantmentUI = UIManagerControl.Instance.OpenUI("DialogoEnchantmentUI", UINodesManager.TopUIRoot, false, UIType.NonPush) as DialogEnchantmentUI; dialogEnchantmentUI.ShowLeftAndRight(text, text3, null, delegate { if (equipLib != null) { EquipmentManager.Instance.SendEnchantEquipResultAckReq(this.CurrentPos, equipLib.wearingId, newExcellentAttr); } }, "放 弃", "更 换"); this.RefreshUI(this.CurrentPos, this.CurrentSlot); }