// 一键强化 protected override void OnClickBtnOne() { // 条件 EquipmentstrengthTemplate eqtemp = DataTemplate.GetInstance().GetEquipStrengthTemplate(HeroStrengthen.Inst.m_CurCard.GetHeroRow().getQosition(), m_Temp.getParts(), m_EquipData.IntensifyLev + 1); int level = eqtemp.getLevel(); // 比较金币 if (ObjectSelf.GetInstance().Money < eqtemp.getNumbers()[0]) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("jinbi_tips1")); return; } if (HeroStrengthen.Inst.m_CurCard.GetHeroData().Level < level) { if (ObjectSelf.GetInstance().Level < m_Temp.getReqlevel()) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("ui_zhuangbeiqianghua8")); return; } } // 判断是否为特殊装备 if (m_Temp.getParts() >= 5) { if (!GetResEnough()) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("ui_zhuangbeiqianghua6")); return; } } // 给服务器发消息 SendMessage(1); }
// 更新装备信息 public void UpdateInfo(ObjectCard card, EquipData equipdata = null) { Card = card; //if ( equipdata == null && m_EquipData != null ) //{ //equipdata = m_EquipData; //} HeroData data = card.GetHeroData(); HeroEquipDB equip = data.HeroEqupDB; List <EquipData> equiplist = equip.EquipList; // 刷新每一个子节点 for (int i = 0; i < equiplist.Count; ++i) { bool ret = false; EquipmentqualityTemplate temp = ( EquipmentqualityTemplate )DataTemplate.GetInstance().m_EquipmentqualityTable.getTableData(equiplist [i].TableID); if (temp.getParts() - 1 == m_Index) { ret = true; } m_Layout.transform.GetChild(temp.getParts() - 1).GetComponent <Equipment> ().UpdateEquipment(equiplist [i], ret, temp.getParts() - 1); } if (equipdata == null) { equipdata = equiplist [m_Index]; } // 刷新右侧功能面板 if (StrengthenEquipment.Inst != null) { StrengthenEquipment.Inst.UpdateInfo(equipdata); } if (EquipLetGood.Inst != null) { EquipLetGood.Inst.UpdateInfo(equipdata); } }
void SendMessage() { CHeroEquipUp proto = new CHeroEquipUp(); proto.herokey = ( int )HeroStrengthen.Inst.m_CurCard.GetHeroData().GUID.GUID_value; proto.islevelup = 1; proto.equiplocation = m_Temp.getParts(); IOControler.GetInstance().SendProtocol(proto); m_TempData = m_EquipData; }
void SendMessage(int isstrength) { CHeroEquipUp proto = new CHeroEquipUp(); proto.herokey = ( int )HeroStrengthen.Inst.m_CurCard.GetHeroData().GUID.GUID_value; proto.islevelup = 0; EquipmentqualityTemplate temp = ( EquipmentqualityTemplate )DataTemplate.GetInstance().m_EquipmentqualityTable.getTableData(m_EquipData.TableID); proto.equiplocation = temp.getParts(); proto.isstrength = isstrength; IOControler.GetInstance().SendProtocol(proto); }
// 更新显示信息 public void UpdateInfo(EquipData equipdata) { // 上方icon m_EquipData = equipdata; int tableid = equipdata.TableID; m_Temp = ( EquipmentqualityTemplate )DataTemplate.GetInstance().m_EquipmentqualityTable.getTableData(tableid); m_Level.text = equipdata.IntensifyLev.ToString(); m_Bg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + GameUtils.GetEquipBgColor(tableid)); m_Icon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + m_Temp.getIcon()); m_Name.text = m_Temp.getName(); m_Name.color = GameUtils.GetEquipNameColor(tableid); // 等级 m_Information.transform.GetChild(0).Find("AttrName").GetComponent <Text> ().text = GameUtils.getString("hero_info_sort_level"); m_Information.transform.GetChild(0).Find("AttrNumber").GetComponent <Text> ().text = equipdata.IntensifyLev + "/" + "10"; // TODO... m_Information.transform.GetChild(0).Find("AttrAdd").gameObject.SetActive(false); // 中间属性 int [] attrs = m_Temp.getQualityAttribute(); int [] attrsvalue = m_Temp.getNumerical(); int i = 0; for ( ; i < attrs.Length; ++i) { m_Information.transform.GetChild(i + 1).gameObject.SetActive(true); m_Information.transform.GetChild(i + 1).Find("AttrName").GetComponent <Text> ().text = GameUtils.GetAttriName(attrs [i]); m_Information.transform.GetChild(i + 1).Find("AttrNumber").GetComponent <Text> ().text = attrsvalue [i].ToString(); m_Information.transform.GetChild(i + 1).Find("AttrAdd").gameObject.SetActive(false); } for (int j = i + 1; j < m_Information.transform.childCount; ++j) { m_Information.transform.GetChild(j).gameObject.SetActive(false); } // 条件 EquipmentstrengthTemplate eqtemp = DataTemplate.GetInstance().GetEquipStrengthTemplate(HeroStrengthen.Inst.m_CurCard.GetHeroRow().getQosition(), m_Temp.getParts(), equipdata.IntensifyLev + 1); int level = eqtemp.getLevel(); if (HeroStrengthen.Inst.m_CurCard.GetHeroData().Level < level) { m_Condition.gameObject.SetActive(true); string str = string.Format(GameUtils.getString("ui_yingxiongqianghua_jinjie3"), level.ToString()); m_Condition.text = str; } else { m_Condition.gameObject.SetActive(false); } // 下方按钮 if (m_Temp.getNextId() == -1) { m_Number.gameObject.SetActive(false); } else { m_Number.gameObject.SetActive(true); m_Number.text = eqtemp.getNumbers() [0].ToString(); } // 特殊装备 EquipmentstrengthTemplate equipTemp = DataTemplate.GetInstance().GetEquipStrengthTemplate(HeroStrengthen.Inst.m_CurCard.GetHeroRow().getQosition(), m_Temp.getParts(), 1); if (m_Temp.getParts() >= 5) { m_ItemLayout.transform.parent.gameObject.SetActive(true); for (int k = 0; k < 3; ++k) { m_ItemLayout.transform.GetChild(k).gameObject.SetActive(k < equipTemp.getPropid2().Length); if (k >= equipTemp.getPropid2().Length) { continue; } m_ItemLayout.transform.GetChild(k).GetComponent <EquipmentItem> ().ShowInfo(equipTemp.getPropid2() [k], equipTemp.getNumbers2() [k]); } } else { m_ItemLayout.transform.parent.gameObject.SetActive(false); } }
public void ShowInfo(EquipData equipdata) { int tableid = equipdata.TableID; EquipmentqualityTemplate temp = ( EquipmentqualityTemplate )DataTemplate.GetInstance().m_EquipmentqualityTable.getTableData(tableid); Debug.Log("tableid" + tableid); EquipmentqualityTemplate nextTemp = ( EquipmentqualityTemplate )DataTemplate.GetInstance().m_EquipmentqualityTable.getTableData(temp.getNextId()); // Left m_LeftLevel.text = equipdata.IntensifyLev.ToString(); // TODO... m_LeftBg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + GameUtils.GetEquipBgColor(tableid)); m_LeftIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + temp.getIcon()); m_Name.text = temp.getName(); m_Name.color = GameUtils.GetEquipNameColor(tableid); // 星级 for (int i = 0; i < 5; ++i) { m_Star.transform.GetChild(i).gameObject.SetActive(i < temp.getQualityLevel()); } // Right m_RightName.text = nextTemp.getName(); m_RightName.color = GameUtils.GetEquipNameColor(nextTemp.GetID()); m_RightLevel.text = equipdata.IntensifyLev.ToString(); m_RightIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + nextTemp.getIcon()); m_RightBg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + GameUtils.GetEquipBgColor(nextTemp.GetID())); // 刷新数据 for (int i = 0; i < m_AttrList.transform.childCount; ++i) { GameObject obj = m_AttrList.transform.GetChild(i).gameObject; if (i < temp.getQualityAttribute().Length) { obj.SetActive(true); obj.transform.Find("Text_Lv").GetComponent <Text> ().text = GameUtils.GetAttriName(temp.getQualityAttribute() [i]); //EquipmentstrengthTemplate equipTemp = DataTemplate.GetInstance ().GetEquipStrengthTemplate ( HeroStrengthen.Inst.m_CurCard.GetHeroRow().getQosition (), //temp.getParts (), equipdata.IntensifyLev ); EquipmentstrengthTemplate equipTemp = DataTemplate.GetInstance().GetEquipStrengthTemplate(HeroStrengthen.Inst.m_CurCard.GetHeroRow().getQosition(), temp.getParts(), 1); if (equipTemp != null) { obj.transform.Find("Text_Gradelimit01").GetComponent <Text> ().text = "+" + temp.getNumerical() [i].ToString(); Debug.Log("temp.getNumbers () [ i ]" + temp.getNumbers() [i].ToString()); if (temp.getNextId() == -1) { obj.transform.Find("Text_Gradelimit02").gameObject.SetActive(false); } else { obj.transform.Find("Text_Gradelimit02").GetComponent <Text> ().text = "+" + (nextTemp.getNumerical() [i].ToString()); } } } else { obj.SetActive(false); } } }