private void infos() { bool flag = this.icon_obj.transform.childCount > 0; if (flag) { for (int i = 0; i < this.icon_obj.transform.childCount; i++) { UnityEngine.Object.Destroy(this.icon_obj.transform.GetChild(i).gameObject); } } GameObject gameObject = IconImageMgr.getInstance().createA3ItemIcon(this.itemdata, false, -1, 1f, false); gameObject.transform.FindChild("iconborder/ismark").gameObject.SetActive(false); gameObject.transform.SetParent(this.icon_obj.transform); gameObject.GetComponent <RectTransform>().localPosition = new Vector3(0f, 0f, 0f); this.name_txt.text = ModelBase <a3_BagModel> .getInstance().getRunestoneDataByid((int)this.itemdata.tpid).item_name; Dictionary <int, int> runeston_att = this.itemdata.runestonedata.runeston_att; foreach (int current in runeston_att.Keys) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.image); gameObject2.SetActive(true); gameObject2.transform.SetParent(this.contain.transform); gameObject2.GetComponent <Text>().text = Globle.getAttrNameById(current) + ":" + runeston_att[current]; } RectTransform component = this.contain.GetComponent <RectTransform>(); RectTransform component2 = this.image.GetComponent <RectTransform>(); component.sizeDelta = new Vector2(component.sizeDelta.x, component2.sizeDelta.y * (float)runeston_att.Count); this.nomask.SetActive(!this.itemdata.ismark); this.mask.SetActive(this.itemdata.ismark); }
void infos() { if (icon_obj.transform.childCount > 0) { for (int i = 0; i < icon_obj.transform.childCount; i++) { Destroy(icon_obj.transform.GetChild(i).gameObject); } } GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(itemdata, false, -1, 1); icon.transform.FindChild("iconborder/ismark").gameObject.SetActive(false); icon.transform.SetParent(icon_obj.transform); icon.GetComponent <RectTransform>().localPosition = new Vector3(0, 0, 0); name_txt.text = a3_BagModel.getInstance().getRunestoneDataByid((int)itemdata.tpid).item_name; Dictionary <int, int> dic = itemdata.runestonedata.runeston_att; foreach (int i in dic.Keys) { GameObject image_clone = GameObject.Instantiate(image) as GameObject; image_clone.SetActive(true); image_clone.transform.SetParent(contain.transform); image_clone.GetComponent <Text>().text = Globle.getAttrNameById(i) + ":" + dic[i]; } RectTransform tsm = contain.GetComponent <RectTransform>(); RectTransform ts = image.GetComponent <RectTransform>(); tsm.sizeDelta = new Vector2(tsm.sizeDelta.x, ts.sizeDelta.y * dic.Count); nomask.SetActive(itemdata.ismark ? false : true); mask.SetActive(itemdata.ismark ? true : false); }
private void OnAttChange() { Transform grid = getComponentByPath <Transform>("att/grid"); for (int i = 0; i < grid.childCount; i++) { Object.Destroy(grid.GetChild(i).gameObject); } SXML next = petmodel.NextLevelConf(); var etor = currentLevel.m_dAtttr.GetEnumerator(); while (etor.MoveNext()) { if (Globle.AttNameIDDic.ContainsKey(etor.Current.Key)) { if (etor.Current.Key == "mp_suck") { continue; } GameObject go = Object.Instantiate(prefab) as GameObject; if (go == null) { return; } go.SetActive(true); Transform trans = go.transform; int id = Globle.AttNameIDDic[etor.Current.Key]; string str = etor.Current.Value.str; if (id == 30 || id == 33) { str = (int.Parse(etor.Current.Value.str) / 10f) + "%"; } trans.FindChild("name").GetComponent <Text>().text = Globle.getAttrNameById(id); trans.FindChild("cur").GetComponent <Text>().text = "+" + str; Text text = trans.FindChild("next").GetComponent <Text>(); if (next != null) { if (id == 30 || id == 33) { text.text = "+" + (int.Parse(next.getString(etor.Current.Key)) / 10f) + "%"; } else { text.text = "+" + next.getString(etor.Current.Key); } } else { text.text = String.Empty; } trans.SetParent(grid, false); } } }
public static string getAttrAddById(int id, int value, bool add = true) { string text = Globle.getAttrNameById(id); bool flag = id == 19 || id == 20 || id == 17; if (flag) { add = false; } bool flag2 = id == 16; if (flag2) { text = text + ":" + value; } else { bool flag3 = id == 17 || id == 19 || id == 20 || id == 24 || id == 25 || id == 29 || id == 30 || id == 31 || id == 32 || id == 33 || id == 35 || id == 36 || id == 37 || id == 39 || id == 40 || id == 17 || id == 41; if (flag3) { bool flag4 = add; if (flag4) { text = string.Concat(new object[] { text, "+", (float)value / 10f, "%" }); } else { text = string.Concat(new object[] { text, "-", (float)value / 10f, "%" }); } } else { bool flag5 = add; if (flag5) { text = text + "+" + value; } else { text = text + "-" + value; } } } return(text); }
void setview() { for (int i = 0; i < con_info.childCount; i++) { Destroy(con_info.GetChild(i).gameObject); } int lvl = a3_EquipModel.getInstance().getHonorPowlvl(); SXML xml = XMLMgr.instance.GetSXML("strength_of_honor"); List <SXML> list = xml.GetNodeList("strength"); List <SXML> attlist = xml.GetNode("strength", "lv==" + lvl).GetNodeList("att"); Dictionary <int, int> att = new Dictionary <int, int>(); foreach (SXML it_info in attlist) { if (att.ContainsKey(it_info.getInt("type"))) { att[it_info.getInt("type")] += it_info.getInt("value"); } else { att[it_info.getInt("type")] = it_info.getInt("value"); } } Dictionary <int, int> att_old = new Dictionary <int, int>(); if (lvl > 1) { List <SXML> attlist1 = xml.GetNode("strength", "lv==" + (lvl - 1)).GetNodeList("att"); foreach (SXML it_info in attlist1) { if (att_old.ContainsKey(it_info.getInt("type"))) { att_old[it_info.getInt("type")] += it_info.getInt("value"); } else { att_old[it_info.getInt("type")] = it_info.getInt("value"); } } } foreach (int type in att.Keys) { GameObject info_clon = Instantiate(info_item) as GameObject; info_clon.SetActive(true); info_clon.transform.SetParent(con_info, false); info_clon.transform.FindChild("old").GetComponent <Text>().text = Globle.getAttrNameById(type) + " +" + att[type]; if (att_old.ContainsKey(type)) { info_clon.transform.FindChild("new").GetComponent <Text>().text = "+" + (att[type] - att_old[type]); } else { info_clon.transform.FindChild("new").GetComponent <Text>().text = "+" + (att[type] - 0); } } }
private void GetAttr(int id, GameObject conatin, GameObject image) { this.deleteAttr(conatin, image); SXML sXML = XMLMgr.instance.GetSXML("achievement.title", "title_id==" + id); List <SXML> nodeList = sXML.GetNodeList("nature", ""); for (int i = 0; i < nodeList.Count; i++) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(image); gameObject.SetActive(true); gameObject.transform.SetParent(conatin.transform, false); gameObject.transform.FindChild("Text").GetComponent <Text>().text = Globle.getAttrNameById(nodeList[i].getInt("att_type")) + ":" + nodeList[i].getInt("att_value"); } this.refreshs(conatin, image); }
public void refreshDashi() { GameObject gameObject = base.transform.FindChild("view/item").gameObject; RectTransform component = base.transform.FindChild("view/con").GetComponent <RectTransform>(); bool flag = component.childCount > 0; if (flag) { for (int i = 0; i < component.childCount; i++) { UnityEngine.Object.Destroy(component.GetChild(i).gameObject); } } SXML sXML = XMLMgr.instance.GetSXML("intensifymaster.level", "lvl==" + ModelBase <PlayerModel> .getInstance().up_lvl); List <SXML> nodeList = sXML.GetNodeList("intensify", ""); foreach (SXML current in nodeList) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject); Text component2 = gameObject2.transform.FindChild("qh_lvl/Text").GetComponent <Text>(); component2.text = "+" + current.getInt("qh"); List <SXML> nodeList2 = current.GetNodeList("att", ""); GameObject gameObject3 = gameObject2.transform.FindChild("scrollview/info_item").gameObject; RectTransform component3 = gameObject2.transform.FindChild("scrollview/con").GetComponent <RectTransform>(); foreach (SXML current2 in nodeList2) { GameObject gameObject4 = UnityEngine.Object.Instantiate <GameObject>(gameObject3); Text component4 = gameObject4.transform.FindChild("Text").GetComponent <Text>(); component4.text = "+" + current2.getInt("value") + Globle.getAttrNameById(current2.getInt("type")); gameObject4.SetActive(true); gameObject4.transform.SetParent(component3, false); } gameObject2.SetActive(true); gameObject2.transform.SetParent(component, false); } float x = gameObject.transform.GetComponent <RectTransform>().sizeDelta.x; float x2 = component.GetComponent <GridLayoutGroup>().spacing.x; Vector2 sizeDelta = new Vector2((float)nodeList.Count * (x + x2), component.sizeDelta.x); component.sizeDelta = sizeDelta; }
public void initLianjie() { GameObject gameObject = base.transform.FindChild("view/item").gameObject; bool flag = this.con.childCount > 0; if (flag) { for (int i = 0; i < this.con.childCount; i++) { UnityEngine.Object.Destroy(this.con.GetChild(i).gameObject); } } SXML sXML = XMLMgr.instance.GetSXML("activate_fun.activate_num", ""); List <SXML> nodeList = sXML.GetNodeList("num", ""); foreach (SXML current in nodeList) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject); Text component = gameObject2.transform.FindChild("count").GetComponent <Text>(); component.text = current.getInt("cout").ToString(); List <SXML> nodeList2 = current.GetNodeList("type", ""); GameObject gameObject3 = gameObject2.transform.FindChild("scrollview/info_item").gameObject; RectTransform component2 = gameObject2.transform.FindChild("scrollview/con").GetComponent <RectTransform>(); foreach (SXML current2 in nodeList2) { GameObject gameObject4 = UnityEngine.Object.Instantiate <GameObject>(gameObject3); Text component3 = gameObject4.transform.FindChild("Text").GetComponent <Text>(); component3.text = Globle.getAttrNameById(current2.getInt("att_type")) + "+" + current2.getInt("att_value"); gameObject4.SetActive(true); gameObject4.transform.SetParent(component2, false); } gameObject2.SetActive(true); gameObject2.transform.SetParent(this.con, false); this.tipObj[current.getInt("cout")] = gameObject2; } float x = gameObject.transform.GetComponent <RectTransform>().sizeDelta.x; float x2 = this.con.GetComponent <GridLayoutGroup>().spacing.x; Vector2 sizeDelta = new Vector2((float)nodeList.Count * (x + x2), this.con.sizeDelta.x); this.con.sizeDelta = sizeDelta; }
public void initLianjie() { GameObject item = transform.FindChild("view/item").gameObject; if (con.childCount > 0) { for (int i = 0; i < con.childCount; i++) { Destroy(con.GetChild(i).gameObject); } } SXML dSXML = XMLMgr.instance.GetSXML("activate_fun.activate_num"); List <SXML> LHcount = dSXML.GetNodeList("num"); foreach (SXML it in LHcount) { GameObject clon = Instantiate(item) as GameObject; Text qh_lvl = clon.transform.FindChild("count").GetComponent <Text>(); qh_lvl.text = it.getInt("cout").ToString(); List <SXML> info = it.GetNodeList("type"); GameObject info_item = clon.transform.FindChild("scrollview/info_item").gameObject; RectTransform con_info = clon.transform.FindChild("scrollview/con").GetComponent <RectTransform>(); foreach (SXML it_info in info) { GameObject info_clon = Instantiate(info_item) as GameObject; Text info_text = info_clon.transform.FindChild("Text").GetComponent <Text>(); info_text.text = Globle.getAttrNameById(it_info.getInt("att_type")) + "+" + it_info.getInt("att_value"); info_clon.SetActive(true); info_clon.transform.SetParent(con_info, false); } clon.SetActive(true); clon.transform.SetParent(con, false); tipObj[it.getInt("cout")] = clon; } float childSizeX = item.transform.GetComponent <RectTransform>().sizeDelta.x; float spacing = con.GetComponent <GridLayoutGroup>().spacing.x; Vector2 newSize = new Vector2(LHcount.Count * (childSizeX + spacing), con.sizeDelta.x); con.sizeDelta = newSize; }
public void refreshDashi() { GameObject item = transform.FindChild("view/item").gameObject; RectTransform con = transform.FindChild("view/con").GetComponent <RectTransform>(); if (con.childCount > 0) { for (int i = 0; i < con.childCount; i++) { Destroy(con.GetChild(i).gameObject); } } SXML dSXML = XMLMgr.instance.GetSXML("intensifymaster.level", "lvl==" + PlayerModel.getInstance().up_lvl); List <SXML> DSlvl = dSXML.GetNodeList("intensify"); foreach (SXML it in DSlvl) { GameObject clon = Instantiate(item) as GameObject; Text qh_lvl = clon.transform.FindChild("qh_lvl/Text").GetComponent <Text>(); qh_lvl.text = "+" + it.getInt("qh"); List <SXML> info = it.GetNodeList("att"); GameObject info_item = clon.transform.FindChild("scrollview/info_item").gameObject; RectTransform con_info = clon.transform.FindChild("scrollview/con").GetComponent <RectTransform>(); foreach (SXML it_info in info) { GameObject info_clon = Instantiate(info_item) as GameObject; Text info_text = info_clon.transform.FindChild("Text").GetComponent <Text>(); info_text.text = "+" + it_info.getInt("value") + Globle.getAttrNameById(it_info.getInt("type")); info_clon.SetActive(true); info_clon.transform.SetParent(con_info, false); } clon.SetActive(true); clon.transform.SetParent(con, false); } float childSizeX = item.transform.GetComponent <RectTransform>().sizeDelta.x; float spacing = con.GetComponent <GridLayoutGroup>().spacing.x; Vector2 newSize = new Vector2(DSlvl.Count * (childSizeX + spacing), con.sizeDelta.x); con.sizeDelta = newSize; }
private void OnAttChange() { Transform componentByPath = base.getComponentByPath <Transform>("att/grid"); for (int i = 0; i < componentByPath.childCount; i++) { UnityEngine.Object.Destroy(componentByPath.GetChild(i).gameObject); } SXML sXML = this.petmodel.NextLevelConf(); Dictionary <string, SXMLAttr> .Enumerator enumerator = this.currentLevel.m_dAtttr.GetEnumerator(); while (enumerator.MoveNext()) { Dictionary <string, int> arg_70_0 = Globle.AttNameIDDic; KeyValuePair <string, SXMLAttr> current = enumerator.Current; bool flag = arg_70_0.ContainsKey(current.Key); if (flag) { current = enumerator.Current; bool flag2 = current.Key == "mp_suck"; if (!flag2) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.prefab); bool flag3 = gameObject == null; if (flag3) { break; } gameObject.SetActive(true); Transform transform = gameObject.transform; Dictionary <string, int> arg_EC_0 = Globle.AttNameIDDic; current = enumerator.Current; int num = arg_EC_0[current.Key]; current = enumerator.Current; string str = current.Value.str; bool flag4 = num == 30 || num == 33; if (flag4) { current = enumerator.Current; str = (float)int.Parse(current.Value.str) / 10f + "%"; } transform.FindChild("name").GetComponent <Text>().text = Globle.getAttrNameById(num); transform.FindChild("cur").GetComponent <Text>().text = "+" + str; Text component = transform.FindChild("next").GetComponent <Text>(); bool flag5 = sXML != null; if (flag5) { bool flag6 = num == 30 || num == 33; if (flag6) { Text arg_203_0 = component; object arg_1FE_0 = "+"; SXML arg_1E3_0 = sXML; current = enumerator.Current; arg_203_0.text = arg_1FE_0 + (float)int.Parse(arg_1E3_0.getString(current.Key)) / 10f + "%"; } else { Text arg_22F_0 = component; string arg_22A_0 = "+"; SXML arg_225_0 = sXML; current = enumerator.Current; arg_22F_0.text = arg_22A_0 + arg_225_0.getString(current.Key); } } else { component.text = string.Empty; } transform.SetParent(componentByPath, false); } } } }
void setInfo(int type) { if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID)) { return; } a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID]; Transform sum_icon = tranObj.transform.FindChild("icon"); for (int i = 0; i < sum_icon.childCount; i++) { GameObject.Destroy(sum_icon.GetChild(i).gameObject); } GameObject icon_sum = IconImageMgr.getInstance().createA3ItemIcon(data.confdata); icon_sum.transform.SetParent(sum_icon, false); //setAvator(); if (!soulObj.ContainsKey(type)) { return; } soulObj[type].transform.FindChild("lvl").GetComponent <Text>().text = data.summondata.shouhun[type].lvl.ToString(); SXML Soulxml = sumXml.GetNode("mon_soul", "soul_id==" + type); int itemid = Soulxml.getInt("item_id"); a3_ItemData item_data = a3_BagModel.getInstance().getItemDataById((uint)itemid); int itemcount = a3_BagModel.getInstance().getItemNumByTpid((uint)itemid); tranObj.transform.FindChild("info/todo/num").GetComponent <Text>().text = itemcount.ToString(); tranObj.transform.FindChild("info/todo/name").GetComponent <Text>().text = item_data.item_name; tranObj.transform.FindChild("info/todo/desc").GetComponent <Text>().text = item_data.desc; tranObj.transform.FindChild("info/lv").GetComponent <Text>().text = data.summondata.shouhun[type].lvl.ToString(); tranObj.transform.FindChild("info/name").GetComponent <Text>().text = Soulxml.getString("name"); Transform itencon = tranObj.transform.FindChild("info/todo/icon"); for (int i = 0; i < itencon.childCount; i++) { GameObject.Destroy(itencon.GetChild(i).gameObject); } a3_ItemData itemdata = a3_BagModel.getInstance().getItemDataById((uint)itemid); GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(itemdata); icon.SetActive(true); icon.transform.SetParent(itencon, false); new BaseButton(icon.transform).onClick = (GameObject go) => { ArrayList arr = new ArrayList(); arr.Add((uint)itemid); arr.Add(1); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr); }; SXML attXml = Soulxml.GetNode("att", "lvl==" + data.summondata.shouhun[type].lvl); List <SXML> attType = attXml.GetNodeList("value"); if (attType.Count > 1) { tranObj.transform.FindChild("info/att").GetComponent <Text>().text = ContMgr.getCont("a3_equiptip_gjl") + ": " + attType[0].getInt("att") + " - " + attType[1].getInt("att"); } else { tranObj.transform.FindChild("info/att").GetComponent <Text>().text = Globle.getAttrNameById(attType[0].getInt("type")) + ": " + attType[0].getInt("att"); } SXML NextAtt = Soulxml.GetNode("att", "lvl==" + (data.summondata.shouhun[type].lvl + 1)); if (NextAtt != null) { List <SXML> _attType = NextAtt.GetNodeList("value"); tranObj.transform.FindChild("info/nextatt").gameObject.SetActive(true); if (_attType.Count > 1) { tranObj.transform.FindChild("info/nextatt").GetComponent <Text>().text = ContMgr.getCont("a3_equiptip_gjl") + ": " + _attType[0].getInt("att") + " - " + _attType[1].getInt("att"); } else { tranObj.transform.FindChild("info/nextatt").GetComponent <Text>().text = Globle.getAttrNameById(_attType[0].getInt("type")) + ": " + _attType[0].getInt("att"); } int maxexp = sumXml.GetNode("mon_soul_exp", "lvl==" + (data.summondata.shouhun[type].lvl + 1)).getInt("need_exp"); tranObj.transform.FindChild("info/jindu/slider").GetComponent <Image>().fillAmount = (float)data.summondata.shouhun[type].exp / maxexp; tranObj.transform.FindChild("info/jindu/text").GetComponent <Text>().text = data.summondata.shouhun[type].exp + "/" + maxexp; } else { tranObj.transform.FindChild("info/jindu/slider").GetComponent <Image>().fillAmount = 1; tranObj.transform.FindChild("info/jindu/text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_shouhun_manji"); tranObj.transform.FindChild("info/nextatt").gameObject.SetActive(false); } }
void showthisOnclick(int id) { nowchooseid = id; panel.SetActive(true); txt.SetActive(false); Dictionary <int, fashionshow_date> dic = A3_FashionShowModel.getInstance().Dic_AllData; if (dic[id].dress_type == 0) { nowchooseid_eqp = id; } else if (dic[id].dress_type == 1) { nowchooseid_body = id; } #region this_icon for (int i = 0; i < contain.transform.childCount; i++) { contain.transform.GetChild(i).transform.FindChild("this").gameObject.SetActive(false); } dic_objs[id].transform.FindChild("this").gameObject.SetActive(true); #endregion #region info c_name.text = dic[id].name; c_shuxing.text = ""; for (int i = 0; i < dic[id].lst_fa.Count; i++) { string nub_str = string.Empty; int nub = dic[id].lst_fa[i].type; if (nub >= 100) { nub_str = dic[id].lst_fa[i].value + "%"; c_shuxing.text += Globle.getAttrNameById(dic[id].lst_fa[i].type - 100) + "+" + nub_str + " "; } else { nub_str = dic[id].lst_fa[i].value.ToString(); c_shuxing.text += Globle.getAttrNameById(dic[id].lst_fa[i].type) + "+" + nub_str + " "; } } c_info.text = dic[id].des; if (A3_FashionShowModel.getInstance().dic_have_fs.ContainsKey(id)) { // long now_time = muNetCleint.instance.CurServerTimeStamp; //long over_time = long.Parse(ConvertStringToDateTime((long)A3_FashionShowModel.getInstance().dic_have_fs[id])); c_time.text = ContMgr.getCont("a3_fashionshow9") + Globle.getStrTime((int)A3_FashionShowModel.getInstance().dic_have_fs[id], true); c_jihuo_obj.SetActive(true); jihuo_info.SetActive(false); c_info.gameObject.SetActive(true); c_time.gameObject.SetActive(true); if (A3_FashionShowModel.getInstance().nowfs[0] == id || A3_FashionShowModel.getInstance().nowfs[1] == id) { btn_buy_obj.SetActive(false); btn_dress_obj.SetActive(false); } else { btn_buy_obj.SetActive(false); btn_dress_obj.SetActive(true); } } else { c_time.text = ContMgr.getCont("a3_fashionshow10"); c_jihuo_obj.SetActive(false); btn_buy_obj.SetActive(true); btn_dress_obj.SetActive(false); jihuo_info.SetActive(true); inti_jihuo_panel(); c_info.gameObject.SetActive(false); c_time.gameObject.SetActive(false); } #endregion #region 模型更改 if (A3_FashionShowModel.getInstance().dress_show) { Show_this_Fashion(); } #endregion }
//属性窗口数值 private void RefreshAtt(int curStage, int curLevel) { SXML stageXml = wingXML.GetNode("wing_stage", "stage_id==" + curStage); SXML levelXml = stageXml.GetNode("wing_level", "level_id==" + curLevel); List <SXML> atts = levelXml.GetNodeList("att", null); Dictionary <int, string> dicAtt = new Dictionary <int, string>(); int att_type; string att_value; string[] attackStr = new string[2]; for (int j = 0; j < atts.Count; j++) { att_type = atts[j].getInt("att_type"); att_value = atts[j].getString("att_value"); if (att_type == 5) { attackStr[1] = att_value; dicAtt.Add(att_type, ""); } else if (att_type == 38) { attackStr[0] = att_value; } else { dicAtt.Add(att_type, att_value); } } if (dicAtt.ContainsKey(5)) { dicAtt[5] = attackStr[0] + "-" + attackStr[1]; } int k = 0; int childCount = conAtt.childCount; List <int> listKeys = dicAtt.Keys.ToList <int>(); for (k = 0; k < listKeys.Count; k++) { GameObject attentity; if (k >= childCount) { attentity = GameObject.Instantiate(tempPgaeAtt) as GameObject; attentity.transform.SetParent(conAtt, false); } else { attentity = conAtt.GetChild(k).gameObject; } attentity.gameObject.SetActive(true); Text textName = attentity.transform.FindChild("text_name").GetComponent <Text>(); Text textValue = attentity.transform.FindChild("text_value").GetComponent <Text>(); if (listKeys[k] == 5) { textName.text = ContMgr.getCont("a3_wing_skin_"); } else { textName.text = Globle.getAttrNameById(listKeys[k]); } textValue.text = dicAtt[listKeys[k]]; } for (int j = k; k < conAtt.childCount; j++) { conAtt.GetChild(j).gameObject.SetActive(false); } }
void setValue() { int honor_mun = 0; int lvl = 0; Dictionary <uint, a3_BagItemData> eqp = a3_EquipModel.getInstance().getEquips(); foreach (a3_BagItemData it in eqp.Values) { if (a3_EquipModel.getInstance().checkCanEquip(it)) { honor_mun = it.equipdata.honor_num + honor_mun; } } SXML xml = XMLMgr.instance.GetSXML("strength_of_honor"); List <SXML> list = xml.GetNodeList("strength"); if (honor_mun >= list[list.Count - 1].getInt("value")) { lvl = list.Count; } else { for (int i = 1; i <= list.Count; i++) { if (honor_mun < list[i - 1].getInt("value")) { lvl = i - 1; break; } } } debug.Log("cunimni" + honor_mun); this.transform.FindChild("lvl").GetComponent <Text>().text = lvl + ContMgr.getCont("ji"); if (lvl <= 0) { //transform.FindChild("attVeiw").gameObject.SetActive(false); //transform.FindChild("tishi").gameObject.SetActive(true); List <SXML> attlist = list[1 - 1].GetNodeList("att"); GameObject info_item_1 = transform.FindChild("attVeiw/info_item_noactive").gameObject; RectTransform con_info = transform.FindChild("attVeiw/con").GetComponent <RectTransform>(); for (int i = 0; i < con_info.childCount; i++) { Destroy(con_info.GetChild(i).gameObject); } foreach (SXML it_info in attlist) { GameObject info_clon = Instantiate(info_item_1) as GameObject; Text info_text = info_clon.transform.FindChild("Text").GetComponent <Text>(); info_text.text = Globle.getAttrNameById(it_info.getInt("type")) + " +" + it_info.getInt("value"); info_clon.SetActive(true); info_clon.transform.SetParent(con_info, false); } } else { //transform.FindChild("attVeiw").gameObject.SetActive(true); //transform.FindChild("tishi").gameObject.SetActive(false); List <SXML> attlist = list[lvl - 1].GetNodeList("att"); GameObject info_item = transform.FindChild("attVeiw/info_item").gameObject; RectTransform con_info = transform.FindChild("attVeiw/con").GetComponent <RectTransform>(); for (int i = 0; i < con_info.childCount; i++) { Destroy(con_info.GetChild(i).gameObject); } foreach (SXML it_info in attlist) { GameObject info_clon = Instantiate(info_item) as GameObject; Text info_text = info_clon.transform.FindChild("Text").GetComponent <Text>(); info_text.text = Globle.getAttrNameById(it_info.getInt("type")) + " +" + it_info.getInt("value"); info_clon.SetActive(true); info_clon.transform.SetParent(con_info, false); } } SXML next = xml.GetNode("strength", "lv==" + (lvl + 1)); if (next != null) { this.transform.FindChild("need").gameObject.SetActive(true); this.transform.FindChild("max").gameObject.SetActive(false); this.transform.FindChild("need/Text").GetComponent <Text>().text = (next.getInt("value") - honor_mun).ToString(); } else { this.transform.FindChild("need").gameObject.SetActive(false); this.transform.FindChild("max").gameObject.SetActive(true); } }
private void RefreshAtt(int carr, int stage, int lvl) { GameObject tempPgaeAtt = this.transform.FindChild("playerInfo/panel_attr/att/att_temp").gameObject; SXML carrXml = XMLMgr.instance.GetSXML("wings.wing", "career==" + carr); SXML satgeXml = carrXml.GetNode("wing_stage", "stage_id==" + stage); SXML lvlXml = satgeXml.GetNode("wing_level", "level_id==" + lvl); List <SXML> atts = lvlXml.GetNodeList("att", null); this.transform.FindChild("playerInfo/panel_attr/name").GetComponent <Text>().text = satgeXml.getString("name"); this.transform.FindChild("playerInfo/panel_attr/lv").GetComponent <Text>().text = "LV" + lvl + "(" + stage + ContMgr.getCont("a3_auction_jie") + ")"; Transform con = this.transform.FindChild("playerInfo/panel_attr/att/grid"); for (int i = 0; i < con.childCount; i++) { Destroy(con.GetChild(i).gameObject); } Dictionary <int, string> dicAtt = new Dictionary <int, string>(); int att_type; float att_value; string[] attackStr = new string[2]; for (int j = 0; j < atts.Count; j++) { att_type = atts[j].getInt("att_type"); att_value = atts[j].getFloat("att_value"); if (att_type == 5) { attackStr[1] = att_value.ToString(); dicAtt.Add(att_type, ""); } else if (att_type == 38) { attackStr[0] = att_value.ToString(); } else { dicAtt.Add(att_type, att_value.ToString()); } } if (dicAtt.ContainsKey(5)) { dicAtt[5] = attackStr[0] + "-" + attackStr[1]; } int k = 0; int childCount = con.childCount; //List<int> listKeys = dicAtt.Keys.ToList<int>(); foreach (int att in dicAtt.Keys) { GameObject attentity; attentity = GameObject.Instantiate(tempPgaeAtt) as GameObject; attentity.transform.SetParent(con, false); attentity.gameObject.SetActive(true); Text textName = attentity.transform.FindChild("text_name").GetComponent <Text>(); Text textValue = attentity.transform.FindChild("text_value").GetComponent <Text>(); textName.text = Globle.getAttrNameById(att); textValue.text = dicAtt[att]; } }
void refreView() { if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID)) { return; } a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID]; List <SXML> explist = sumXml.GetNodeList("mon_soul_exp"); foreach (int type in data.summondata.shouhun.Keys) { if (!shouhunObj.ContainsKey(type)) { continue; } SXML Soulxml = sumXml.GetNode("mon_soul", "soul_id==" + type); int itemid = Soulxml.getInt("item_id"); int itemcount = a3_BagModel.getInstance().getItemNumByTpid((uint)itemid); shouhunObj[type].transform.FindChild("todo/num").GetComponent <Text>().text = itemcount.ToString(); shouhunObj[type].transform.FindChild("lv").GetComponent <Text>().text = data.summondata.shouhun[type].lvl.ToString(); if (data.summondata.shouhun[type].lvl > 0) { SXML attXml = Soulxml.GetNode("att", "lvl==" + data.summondata.shouhun[type].lvl); List <SXML> attType = attXml.GetNodeList("value"); if (attType.Count > 1) { shouhunObj[type].transform.FindChild("att").GetComponent <Text>().text = ContMgr.getCont("a3_equiptip_gjl") + ": " + attType[0].getInt("att") + " - " + attType[1].getInt("att"); } else { shouhunObj[type].transform.FindChild("att").GetComponent <Text>().text = Globle.getAttrNameById(attType[0].getInt("type")) + ": " + attType[0].getInt("att"); } } else { SXML attXml = Soulxml.GetNode("att", "lvl==" + (data.summondata.shouhun[type].lvl + 1)); List <SXML> attType = attXml.GetNodeList("value"); if (attType.Count > 1) { shouhunObj[type].transform.FindChild("att").GetComponent <Text>().text = ContMgr.getCont("a3_equiptip_gjl") + ": " + 0 + " - " + 0; } else { shouhunObj[type].transform.FindChild("att").GetComponent <Text>().text = Globle.getAttrNameById(attType[0].getInt("type")) + ": " + 0; } } SXML NextAtt = Soulxml.GetNode("att", "lvl==" + (data.summondata.shouhun[type].lvl + 1)); if (NextAtt != null) { List <SXML> _attType = NextAtt.GetNodeList("value"); if (_attType.Count > 1) { shouhunObj[type].transform.FindChild("nextatt").GetComponent <Text>().text = ContMgr.getCont("a3_equiptip_gjl") + ": " + _attType[0].getInt("att") + " - " + _attType[1].getInt("att"); } else { shouhunObj[type].transform.FindChild("nextatt").GetComponent <Text>().text = Globle.getAttrNameById(_attType[0].getInt("type")) + ": " + _attType[0].getInt("att"); } int maxexp = sumXml.GetNode("mon_soul_exp", "lvl==" + (data.summondata.shouhun[type].lvl + 1)).getInt("need_exp"); shouhunObj[type].transform.FindChild("jindu/slider").GetComponent <Image>().fillAmount = (float)data.summondata.shouhun[type].exp / maxexp; } //List<SXML> lvlList = Soulxml.GetNodeList("att"); //int alllvl = lvlList.Count; //shouhunObj[type].transform.FindChild("jindu/slider").GetComponent<Image>().fillAmount = (float)data.summondata.shouhun[type].lvl / alllvl; } }
public void ShowEquipTip(uint itemId) { if (itemIcon.transform.childCount > 0) { for (int i = itemIcon.transform.childCount - 1; i >= 0; i--) { GameObject.Destroy(itemIcon.transform.GetChild(i).gameObject); } } textBaseHead.gameObject.SetActive(false); IconImageMgr.getInstance().createA3ItemIcon(itemId, ignoreLimit: true).transform.SetParent(itemIcon.transform, false); SXML item = a3_BagModel.getInstance().getItemXml((int)itemId); textItemName.text = item.getString("item_name"); //职业 int carr = item.getInt("job_limit"); switch (carr) { default: case -1: textCarrLimit.text = ContMgr.getCont("a3_active_wuxianzhi"); break; case 2: textCarrLimit.text = ContMgr.getCont("a3_firstRechargeAward_p1"); break; case 3: textCarrLimit.text = ContMgr.getCont("a3_firstRechargeAward_p2"); break; case 5: textCarrLimit.text = ContMgr.getCont("a3_firstRechargeAward_p3"); break; } //基础属性 int attType = item.getInt("att_type"); SXML itemInfo = XMLMgr.instance.GetSXML("item.stage", "stage_level==0"); SXML eqpInfo = itemInfo.GetNode("stage_info", "itemid==" + itemId); if (eqpInfo != null) { switch (attType) { case 5: string[] attackValue = eqpInfo.getString("basic_att").Split(','); int minVal, maxVal; if (attackValue.Length == 1) { maxVal = minVal = int.Parse(attackValue[0]); } else if (attackValue.Length == 2) { minVal = int.Parse(attackValue[0]); maxVal = int.Parse(attackValue[1]); } else { return; } textBaseAttr.text = ContMgr.getCont("a3_mapChangeLine10", new List <string>() { minVal.ToString(), maxVal.ToString() }); //"攻击"属性存在一个范围 break; default: int val = eqpInfo.getInt("basic_att"); textBaseAttr.text = string.Format("{0}:{1}", Globle.getAttrNameById(attType), val); //其它属性是没有范围的 break; } } //基础追加属性 textAddAttr.text = Globle.getAttrNameById(item.getInt("att_type")); //其它Tips说明 SXML itemTip = item.GetNode("default_tip"); if (itemTip == null) { Debug.LogError("未配置default_tip"); return; } textTipDesc.text = itemTip.getString("equip_desc"); List <SXML> listItemTipExtraDesc = itemTip.GetNodeList("random_tip"); for (int i = 0; i < listItemTipExtraDesc.Count; i++) { if (i >= listTextExtraDesc.Count) { break; } listTextExtraDesc[i].text = listItemTipExtraDesc[i].getString("tip"); } ShowBgImgByQuality(item.getInt("quality"), beginWith: 1); }
private void RefreshAtt(int curStage, int curLevel) { SXML node = this.wingXML.GetNode("wing_stage", "stage_id==" + curStage); SXML node2 = node.GetNode("wing_level", "level_id==" + curLevel); List <SXML> nodeList = node2.GetNodeList("att", null); Dictionary <int, string> dictionary = new Dictionary <int, string>(); string[] array = new string[2]; for (int i = 0; i < nodeList.Count; i++) { int @int = nodeList[i].getInt("att_type"); float @float = nodeList[i].getFloat("att_value"); bool flag = @int == 5; if (flag) { array[1] = @float.ToString(); dictionary.Add(@int, ""); } else { bool flag2 = @int == 38; if (flag2) { array[0] = @float.ToString(); } else { dictionary.Add(@int, @float.ToString()); } } } bool flag3 = dictionary.ContainsKey(5); if (flag3) { dictionary[5] = array[0] + "-" + array[1]; } int childCount = this.conAtt.childCount; List <int> list = dictionary.Keys.ToList <int>(); int j; for (j = 0; j < list.Count; j++) { bool flag4 = j >= childCount; GameObject gameObject; if (flag4) { gameObject = UnityEngine.Object.Instantiate <GameObject>(this.tempPgaeAtt); gameObject.transform.SetParent(this.conAtt, false); } else { gameObject = this.conAtt.GetChild(j).gameObject; } gameObject.gameObject.SetActive(true); Text component = gameObject.transform.FindChild("text_name").GetComponent <Text>(); Text component2 = gameObject.transform.FindChild("text_value").GetComponent <Text>(); bool flag5 = list[j] == 5; if (flag5) { component.text = "攻击力"; } else { component.text = Globle.getAttrNameById(list[j]); } component2.text = dictionary[list[j]]; } int num = j; while (j < this.conAtt.childCount) { this.conAtt.GetChild(num).gameObject.SetActive(false); num++; } }