//刷新属性 void show_attribute(int id, hallowsData data) { for (int i = 0; i < lsts_attributes.Count; i++) { int attribute_name = A3_HallowsModel.getInstance().GetAttributeForQuality(data.h_s_d.quality)[i].Keys.ElementAt(0);//字典key的下标 float attribute_value = A3_HallowsModel.getInstance().GetAttributeForQuality(data.h_s_d.quality)[i][attribute_name]; lsts_attributes[i].GetComponent <Text>().text = Globle.getAttrAddById(attribute_name, (int)((attribute_value + attribute_value * data.lvl * 0.1f)) + 1); } }
void showAtt() { foreach (uint type in change_att[0].Keys) { curtype = type; GameObject clon = Instantiate(item); clon.SetActive(true); int nowAtt = PlayerModel.getInstance().attr_list[type]; clon.transform.FindChild("attValue").GetComponent <Text>().text = Globle.getAttrAddById((int)type, nowAtt - change_att[0][type]); int ss = 0; DOTween.To(() => ss, (float s) => { ss = (int)s; clon.transform.FindChild("addValue").GetComponent <Text>().text = Globle.getAttrAddById_value((int)type, ss, true); }, (float)nowAtt, 1f); clon.transform.SetParent(con, false); //change_att[0].Remove(curtype); // break; } wite(); }
void setInfo_lianxie() { if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID)) { return; } a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID]; tranObj.transform.FindChild("r2/lvl").GetComponent <Text>().text = "LV " + data.summondata.level; tranObj.transform.FindChild("r2/name").GetComponent <Text>().text = data.summondata.name; tranObj.transform.FindChild("r2/Combpt").GetComponent <Text>().text = data.summondata.linkCombpt.ToString(); for (int i = 0; i < attCon.childCount; i++) { attCon.GetChild(i).gameObject.SetActive(false); } int n = 1; foreach (int idx in data.summondata.linkdata.Keys) { attCon.FindChild("att" + n).gameObject.SetActive(true); attCon.FindChild("att" + n).FindChild("null").gameObject.SetActive(false); attCon.FindChild("att" + n).FindChild("att").gameObject.SetActive(false); if (data.summondata.linkdata[idx].type == 0) { attCon.FindChild("att" + n).FindChild("null").gameObject.SetActive(true); } else { attCon.FindChild("att" + n).FindChild("att").gameObject.SetActive(true); int attvalue = (int)Math.Ceiling((A3_SummonModel.getInstance().getAttValue(data.summondata, data.summondata.linkdata[idx].type) * ((float)data.summondata.linkdata[idx].per / 100.00f))); attCon.FindChild("att" + n).FindChild("att").GetComponent <Text>().text = Globle.getAttrAddById(data.summondata.linkdata[idx].type, attvalue); } n++; } }
void setlianxie_Value() { if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID)) { return; } a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID]; if (data.summondata.linkdata == null) { return; } GameObject item = tranObj.transform.FindChild("r1/main/con_btn/scrollview/btnTemp").gameObject; Transform con = tranObj.transform.FindChild("r1/main/con_btn/scrollview/con"); for (int i = 0; i < con.childCount; i++) { GameObject.Destroy(con.GetChild(i).gameObject); } foreach (int idx in data.summondata.linkdata.Keys) { GameObject clon = GameObject.Instantiate(item) as GameObject; clon.SetActive(true); clon.transform.SetParent(con, false); if (data.summondata.linkdata[idx].type == 0) { clon.transform.FindChild("nulType").gameObject.SetActive(true); } else { clon.transform.FindChild("have").gameObject.SetActive(true); string str = data.summondata.linkdata[idx].per + "%"; if (data.summondata.linkdata[idx].per >= 1 && data.summondata.linkdata[idx].per <= 5) { str = "<color=#00FF00>" + str + "</color>"; } else if (data.summondata.linkdata[idx].per >= 6 && data.summondata.linkdata[idx].per <= 9) { str = "<color=#66FFFF>" + str + "</color>"; } else if (data.summondata.linkdata[idx].per >= 10 && data.summondata.linkdata[idx].per <= 13) { str = "<color=#FF00FF>" + str + "</color>"; } else if (data.summondata.linkdata[idx].per >= 14 && data.summondata.linkdata[idx].per <= 19) { str = "<color=#f7790a>" + str + "</color>"; } else if (data.summondata.linkdata[idx].per >= 20) { str = "<color=#f90e0e>" + str + "</color>"; } clon.transform.FindChild("have/value").GetComponent <Text>().text = str; int attvalue = (int)Math.Ceiling((A3_SummonModel.getInstance().getAttValue(data.summondata, data.summondata.linkdata[idx].type) * ((float)data.summondata.linkdata[idx].per / 100.00f))); clon.transform.FindChild("have/att").GetComponent <Text>().text = Globle.getAttrAddById(data.summondata.linkdata[idx].type, attvalue); bool loack = data.summondata.linkdata[idx].lock_state; if (loack) { clon.transform.FindChild("have/loack").GetComponent <Image>().enabled = false; clon.transform.FindChild("have/loack/b").gameObject.SetActive(loack); } else { clon.transform.FindChild("have/loack").GetComponent <Image>().enabled = true; clon.transform.FindChild("have/loack/b").gameObject.SetActive(loack); } int indx = idx; new BaseButton(clon.transform.FindChild("have/loack")).onClick = (GameObject go) => { if (loack) { if (getSummonWin() == null) { return; } GameObject toSrue = getSummonWin().GetSmallWin("uilayer_unlock"); index = indx; toSrue.SetActive(true); } else { if (getSummonWin() == null) { return; } GameObject toSrue = getSummonWin().GetSmallWin("uilayer_lock"); index = indx; toSrue.SetActive(true); int num = sumXml.GetNode("link").getInt("change_lock_num"); int itemid = sumXml.GetNode("link").getInt("change_lock"); lockItem = itemid; int haveCount = a3_BagModel.getInstance().getItemNumByTpid((uint)itemid); if (num <= haveCount) { toSrue.transform.FindChild("num").GetComponent <Text>().text = "<color=#00FF56FF>" + haveCount + "/" + num + "</color>"; //toSrue.transform.FindChild("yes").GetComponent<Button>().interactable = true; CanLock = true; } else { toSrue.transform.FindChild("num").GetComponent <Text>().text = "<color=#f90e0e>" + haveCount + "/" + num + "</color>"; //toSrue.transform.FindChild("yes").GetComponent<Button>().interactable = false; CanLock = false; } } }; } } if (data.summondata.linkdata.Count < data.summondata.star) { GameObject clon_null = GameObject.Instantiate(item) as GameObject; clon_null.transform.FindChild("nul").gameObject.SetActive(true); clon_null.transform.SetParent(con, false); clon_null.SetActive(true); new BaseButton(clon_null.transform.FindChild("nul/btn")).onClick = (GameObject go) => { if (getSummonWin() == null) { return; } GameObject toSrue = getSummonWin().GetSmallWin("uilayer_addlianxie"); toSrue.SetActive(true); int num = sumXml.GetNode("link").getInt("add_link_num"); int itemid = sumXml.GetNode("link").getInt("add_link"); AddlianxieId = itemid; int haveCount = a3_BagModel.getInstance().getItemNumByTpid((uint)itemid); if (num <= haveCount) { toSrue.transform.FindChild("num").GetComponent <Text>().text = "<color=#00FF56FF>" + haveCount + "/" + num + "</color>"; //toSrue.transform.FindChild("yes").GetComponent<Button>().interactable = true; CanAdd = true; } else { toSrue.transform.FindChild("num").GetComponent <Text>().text = "<color=#f90e0e>" + haveCount + "/" + num + "</color>"; //toSrue.transform.FindChild("yes").GetComponent<Button>().interactable = false; CanAdd = false; } }; } }