protected override void OnClickBtnStrengthen() { if (m_Temp.getNextId() == -1) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("ui_zhuangbeiqianghua11")); return; } if (ObjectSelf.GetInstance().Money < m_Temp.getDemandmoney()) { //InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("jinbi_tips1")); UICommonManager.Inst.ShowMsgBox("", GameUtils.getString("jinbi_tips1")); return; } if (HeroStrengthen.Inst.m_CurCard.GetHeroData().Level < m_Temp.getReqlevel()) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("ui_yingxiongqianghua_jinjie3").Replace("{0}", m_Temp.getReqlevel().ToString())); return; } // 需求道具数量对比 for (int i = 0; i < m_Temp.getPropId().Length; ++i) { int num = GetIdInBagNum(m_Temp.getPropId() [i]); if (num < m_Temp.getNumbers() [i]) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("ui_zhuangbeiqianghua9")); return; } } SendMessage(); }
// 刷新数据 public void UpdateInfo(EquipData equipdata) { m_EquipData = equipdata; int tableid = equipdata.TableID; m_Temp = ( EquipmentqualityTemplate )DataTemplate.GetInstance().m_EquipmentqualityTable.getTableData(tableid); m_NextTemp = ( EquipmentqualityTemplate )DataTemplate.GetInstance().m_EquipmentqualityTable.getTableData(m_Temp.getNextId()); // 已经到达最高级 //if ( m_Temp.getNextId () == -1 ) //{ // return; //} m_LeftLevel.text = equipdata.IntensifyLev.ToString(); // TODO... m_LeftBg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + GameUtils.GetEquipBgColor(tableid)); m_LeftIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + m_Temp.getIcon()); m_LeftName.text = m_Temp.getName(); m_LeftName.color = GameUtils.GetEquipNameColor(tableid); // 星级 for (int k = 0; k < 5; ++k) { Star.transform.GetChild(k).gameObject.SetActive(k < m_Temp.getQualityLevel()); } // 中间属性 int [] attrs = m_Temp.getQualityAttribute(); int [] attrsvalue = m_Temp.getNumerical(); int i = 0; for (i = 0; i < attrs.Length; ++i) { m_Information.transform.GetChild(i).gameObject.SetActive(true); m_Information.transform.GetChild(i).Find("AttrName").GetComponent <Text> ().text = GameUtils.GetAttriName(attrs [i]); m_Information.transform.GetChild(i).Find("AttrNumber").GetComponent <Text> ().text = "+" + attrsvalue [i].ToString(); m_Information.transform.GetChild(i).Find("AttrAdd").GetComponent <Text> ().text = "+" + (m_NextTemp.getNumbers() [i] - m_Temp.getNumbers() [i]).ToString(); Debug.Log("Debug.Log ( attrsvalue [ i ].ToString () ); " + attrsvalue [i].ToString()); } // 达到最高级 if (m_Temp.getNextId() == -1) { return; } // 右边 对应的显示 m_RightLevel.text = m_EquipData.IntensifyLev.ToString(); // TODO... m_RightBg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + GameUtils.GetEquipBgColor(m_NextTemp.getId())); m_RightIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + m_NextTemp.getIcon()); m_Name.text = m_NextTemp.getName(); m_Name.color = GameUtils.GetEquipNameColor(m_NextTemp.getId()); for (int j = i; j < m_Information.transform.childCount; ++j) { m_Information.transform.GetChild(j).gameObject.SetActive(false); } // 刷新列表 for (int k = 0; k < 6; ++k) { m_ItemLayout.transform.GetChild(k).gameObject.SetActive(k < m_Temp.getPropId().Length); if (k >= m_Temp.getPropId().Length) { continue; } m_ItemLayout.transform.GetChild(k).GetComponent <EquipmentItem> ().ShowInfo(m_Temp.getPropId() [k], m_Temp.getNumbers() [k]); } // 条件 int level = m_Temp.getReqlevel(); 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); } m_Number.text = m_Temp.getDemandmoney().ToString(); }
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); } } }