private void SetGameObjectData(GameObject item, AttConfigVo vo, GameObject parent) { Text text_name = item.transform.FindChild("text_name").GetComponent <Text>(); Text text_value = item.transform.FindChild("text_value").GetComponent <Text>(); //text_name.text = Globle.getAttrNameById( vo.att_type ); text_name.text = Globle.getString(vo.att_type + "_" + PlayerModel.getInstance().profession); text_value.text = vo.add + ""; item.SetActive(true); item.transform.SetParent(parent.transform); item.transform.localScale = Vector3.one; }
void setValue_tishi_cc() { a3_BagItemData data = a3_EquipModel.getInstance().getEquipByAll(eqp2_id); a3_BagItemData data1 = a3_EquipModel.getInstance().getEquipByAll(eqp1_id); string[] list_need1; string[] list_need2; int need1; int need2; SXML stage_xml = XMLMgr.instance.GetSXML("item.stage", "stage_level==" + (data1.equipdata.stage)).GetNode("stage_info", "itemid==" + data.tpid); if (stage_xml == null) { return; } SXML blessing = XMLMgr.instance.GetSXML("item.blessing", "blessing_level==" + data.equipdata.blessing_lv); list_need1 = stage_xml.getString("equip_limit1").Split(','); list_need2 = stage_xml.getString("equip_limit2").Split(','); need1 = int.Parse(list_need1[1]) * (100 - blessing.getInt("blessing_att")) / 100; need2 = int.Parse(list_need2[1]) * (100 - blessing.getInt("blessing_att")) / 100; string text_need1, text_need2; bool cando1 = true; bool cando2 = true; if (need1 <= PlayerModel.getInstance().attr_list[uint.Parse(list_need1[0])]) { cando1 = true; // text_need1 = " <color=#00FF00>" + Globle.getAttrNameById(int.Parse(list_need1[0])) + need1 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need1[0])] + ")" + "</color>"; text_need1 = "<color=#00FF00>" + Globle.getString(int.Parse(list_need1[0]) + "_" + PlayerModel.getInstance().profession) + need1 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need1[0])] + ")" + "</color>"; } else { cando1 = false; // text_need1 = " <color=#f90e0e>" + Globle.getAttrNameById(int.Parse(list_need1[0])) + need1 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need1[0])] + ")" + "</color>"; text_need1 = "<color=#f90e0e>" + Globle.getString(int.Parse(list_need1[0]) + "_" + PlayerModel.getInstance().profession) + need1 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need1[0])] + ")" + "</color>"; } if (need2 <= PlayerModel.getInstance().attr_list[uint.Parse(list_need2[0])]) { cando2 = true; // text_need2 = " <color=#00FF00>" + Globle.getAttrNameById(int.Parse(list_need2[0])) + need2 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need2[0])] + ")" + "</color>"; text_need2 = "<color=#00FF00>" + Globle.getString(int.Parse(list_need2[0]) + "_" + PlayerModel.getInstance().profession) + need2 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need2[0])] + ")" + "</color>"; } else { cando2 = false; //text_need2 = " <color=#f90e0e>" + Globle.getAttrNameById(int.Parse(list_need2[0])) + need2 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need2[0])] + ")" + "</color>"; text_need2 = "<color=#f90e0e>" + Globle.getString(int.Parse(list_need2[0]) + "_" + PlayerModel.getInstance().profession) + need2 + "(" + ContMgr.getCont("a3_equiptip_dangqian") + PlayerModel.getInstance().attr_list[uint.Parse(list_need2[0])] + ")" + "</color>"; } if (cando1 && cando2) { transform.FindChild("yes").gameObject.SetActive(true); transform.FindChild("no").gameObject.SetActive(true); transform.FindChild("money").gameObject.SetActive(true); transform.FindChild("retun").gameObject.SetActive(false); transform.FindChild("retunText").gameObject.SetActive(false); } else { transform.FindChild("yes").gameObject.SetActive(false); transform.FindChild("no").gameObject.SetActive(false); transform.FindChild("money").gameObject.SetActive(false); transform.FindChild("retun").gameObject.SetActive(true); transform.FindChild("retunText").gameObject.SetActive(true); } transform.FindChild("value1").GetComponent <Text>().text = text_need1; transform.FindChild("value2").GetComponent <Text>().text = text_need2; }