//9个位置icon的创建 void creatrveicon(int id) { Dictionary <int, hallowsData> dic = A3_HallowsModel.getInstance().now_hallows(); GameObject iconf = lsts_nine_region[id - 1].transform.FindChild("icon/icon").gameObject; GameObject icon = IconImageMgr.getInstance().createA3ItemIcon((uint)dic[id].item_id, true, -1, 1, true); icon.transform.SetParent(iconf.transform, false); Text name = lsts_nine_region[id - 1].transform.FindChild("name").GetComponent <Text>(); string item_name = XMLMgr.instance.GetSXML("item.item", "id==" + (uint)dic[id].item_id).getString("item_name"); name.text = Globle.getColorStrByQuality(item_name, dic[id].h_s_d.quality); a3_BagItemData data = new a3_BagItemData(); data.tpid = (uint)dic[id].item_id; data.num = 1; a3_ItemData da = new a3_ItemData(); da = a3_BagModel.getInstance().getItemDataById(data.tpid); data.confdata = da; data.ishallows = true; new BaseButton(icon.transform).onClick = delegate(GameObject go) { this.itemOnclick(icon, data, 3); ShoworHideModel(false); }; }
private void onDeleteChar(GameEvent e) { bool flag = e.data["res"] < 0; if (flag) { Globle.err_output(e.data["res"]); } else { flytxt.instance.fly(ContMgr.getCont("role_delete", null), 0, default(Color), null); } Variant data = e.data; bool flag2 = data["res"]._int > 0; if (flag2) { uint @uint = data["cid"]._uint; for (int i = 0; i < this._chas.Count; i++) { bool flag3 = this._chas[i].ContainsKey("cid") && this._chas[i]["cid"]._uint == @uint; if (flag3) { this._chas._arr.RemoveAt(i); } } base.dispatchEvent(GameEvent.Create(4032u, this, data, false)); } }
private void initItemInfo() { Transform transform = base.transform.FindChild("info"); transform.FindChild("name").GetComponent <Text>().text = this.item_data.confdata.item_name; transform.FindChild("name").GetComponent <Text>().color = Globle.getColorByQuality(this.item_data.confdata.quality); transform.FindChild("desc").GetComponent <Text>().text = this.item_data.confdata.desc; transform.FindChild("value").GetComponent <Text>().text = this.item_data.confdata.value.ToString(); Transform transform2 = transform.FindChild("icon"); bool flag = transform2.childCount > 0; if (flag) { UnityEngine.Object.Destroy(transform2.GetChild(0).gameObject); } GameObject gameObject = IconImageMgr.getInstance().createA3ItemIcon(this.item_data, false, -1, 1f, false); gameObject.transform.SetParent(transform2, false); this.cur_num = 1; string arg_12F_0 = this.item_data.summondata.isSpecial ? "变异*" : ""; transform.FindChild("grade").GetComponent <Text>().text = ModelBase <A3_SummonModel> .getInstance().IntGradeToStr(this.item_data.summondata.grade); transform.FindChild("type").GetComponent <Text>().text = ModelBase <A3_SummonModel> .getInstance().IntNaturalToStr(this.item_data.summondata.naturaltype); }
public void onNPCShop(Variant data) { debug.Log("NPCSHOP============" + data.dump()); int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); bool flag2 = num == -5100; if (flag2) { this.sendShowFloat((uint)ModelBase <A3_NPCShopModel> .getInstance().listNPCShop[0].getInt("shop_id")); } } else { switch (num) { case 1: this.onFloat(data); break; case 2: this.onBuy(data); break; case 3: this.onRefresh(data); break; } } }
public void on_begin_change_map_res(Variant v) { debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>on_begin_change_map_res>" + v.dump()); if (v["res"] == 1) { Variant var = new Variant(); var["gto"] = v["gto"]; var["gate"] = v["gate"]; if (v.ContainsKey("line")) { var["line"] = v["line"]; } if (loading_cloud.instance == null) { loading_cloud.showhandle = () => { sendRPC(PKG_NAME.C2S_ONMAPCHANGE, var); }; InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.LOADING_CLOUD); } else { sendRPC(PKG_NAME.C2S_ONMAPCHANGE, var); } change_map = true; } else { InterfaceMgr.getInstance().DisposeUI(InterfaceMgr.LOADING_CLOUD); changingMap = false; SelfRole.fsm.Stop(); Globle.err_output(v["res"]); } }
void initItemInfo() { Transform info = transform.FindChild("info"); info.FindChild("name").GetComponent <Text>().text = item_data.confdata.item_name; info.FindChild("name").GetComponent <Text>().color = Globle.getColorByQuality(item_data.confdata.quality); info.FindChild("desc").GetComponent <Text>().text = item_data.confdata.desc; if (item_data.confdata.use_limit > 0) { info.FindChild("lv").GetComponent <Text>().text = item_data.confdata.use_limit + ContMgr.getCont("zhuan") + item_data.confdata.use_lv + ContMgr.getCont("ji"); } else { info.FindChild("lv").GetComponent <Text>().text = ContMgr.getCont("a3_active_wuxianzhi"); } Transform Image = info.FindChild("icon"); if (Image.childCount > 0) { Destroy(Image.GetChild(0).gameObject); } GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(item_data); icon.transform.SetParent(Image, false); transform.FindChild("info/donum").GetComponent <Text>().text = item_data.num.ToString(); }
public void ChangeRideDressS2cData(Variant s2cData) { rideInfo.dress = s2cData.getValue("dress")._uint; if (s2cData.ContainsKey("lock_dress")) { var lockdress = s2cData.getValue("lock_dress")._uint; rideInfo.ridedressMapiping.Remove(lockdress); // 限时坐骑 移除 Globle.err_output(-5704); } rideInfo.configVo = GetValueByType <RideConfigVo>((int)rideInfo.dress); if (SelfRole._inst != null && rideInfo.mount == ( uint )RIDESTATE.UP && A3_RideProxy.IsCanChangeRide(SelfRole._inst.dianjiTime)) { if (SelfRole._inst.invisible) { return; //隐身状态 } SelfRole._inst.set_Ride(( int )rideInfo.dress, true); } }
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 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 Update() { if (a3_liteMinimap.instance == null) { return; } if (Globle.formatTime((int)a3_liteMinimap.instance.active_leftTm) == "00:00:00") { IconAddLightMgr.getInstance().showOrHideFire("Light_btnCseth", false); if (System.DateTime.Now.Hour >= 20 || System.DateTime.Now.Hour <= 12) { time_txt.text = ContMgr.getCont("a3_active_godlight_nexttime1"); } else { time_txt.text = ContMgr.getCont("a3_active_godlight_nexttime2"); } } else { IconAddLightMgr.getInstance().showOrHideFire("Light_btnCseth", false); time_txt.text = Globle.formatTime((int)a3_liteMinimap.instance.active_leftTm); } }
public void OnAddOnClick() { new BaseButton(this.transform.FindChild("help_btn")).onClick = (GameObject go) => { helpcon.SetActive(true); }; new BaseButton(helpcon.transform.FindChild("close")).onClick = (GameObject go) => { helpcon.SetActive(false); }; _btn.onClick = (go) => { if (_btn.interactable == false) { return; } if (needNum > haveNum) { Globle.err_output(-1104); ArrayList data = new ArrayList(); data.Add(a3_BagModel.getInstance().getItemDataById(A3_RideModel.getInstance().GetUpGradeGiftItemId())); data.Add(InterfaceMgr.RIDE_A3); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data); return; } _btn.interactable = false; A3_RideProxy.getInstance().SendC2S(3, "type", (uint)defaulSelect + 1); }; }
private void dartinfo(Variant data) { debug.Log("镖车信息:" + data.dump()); int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); } else { switch (num) { case 1: this.info(data); break; case 2: this.wannaGo(data); break; case 3: this.itemNum(data); break; case 4: this.dartHP(data); break; } } }
private void _getSeverListBack(Variant data) { debug.Log("收到服务器列表信息: " + data.dump()); bool flag = data["r"]._int == 0; if (flag) { bool flag2 = data.ContainsKey("errmsg"); if (flag2) { debug.Log("SeverListError::" + StringUtils.unicodeToStr(data["errmsg"]._str)); } this.retryLoadServerList(); } else { bool flag3 = data["r"]._int == 1; if (flag3) { bool flag4 = data.ContainsKey("data"); if (flag4) { this._srv_lists = data["data"]["srv_lists"]; Variant variant = new Variant(); variant["svrList"] = this._srv_lists; this.notify(variant); Globle.initServer(this._srv_lists._arr); login.instance.refresh(); } } } }
//删除角色 private void onDeleteChar(GameEvent e) { if (e.data["res"] < 0) { Globle.err_output(e.data["res"]); } else { flytxt.instance.fly(ContMgr.getCont("role_delete")); } Variant data = e.data; if (data["res"]._int > 0) { uint cid = data["cid"]._uint; for (int i = 0; i < _chas.Count; i++) { if (_chas[i].ContainsKey("cid") && _chas[i]["cid"]._uint == cid) { _chas._arr.RemoveAt(i); } } this.dispatchEvent(GameEvent.Create(UI_EVENT.UI_ACT_DELETE_CHAR, this, data)); //if (selchar.instance) // selchar.instance.onDelChar(data); } }
//private void initItemInfo() //{ // Transform info = transform.FindChild("info"); // info.FindChild("name").GetComponent<Text>().text = item_data.confdata.item_name; // info.FindChild("name").GetComponent<Text>().color = Globle.getColorByQuality(item_data.confdata.quality); // info.FindChild("desc").GetComponent<Text>().text = item_data.confdata.desc; // info.FindChild("value").GetComponent<Text>().text = item_data.confdata.value.ToString(); // Transform Image = info.FindChild("icon"); // if (Image.childCount > 0) // { // Destroy(Image.GetChild(0).gameObject); // } // GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(item_data); // icon.transform.SetParent(Image, false); // cur_num = 1; // var spestr = item_data.summondata.isSpecial ? ContMgr.getCont("a3_summon16") +"*" : ""; // info.FindChild("grade").GetComponent<Text>().text = A3_SummonModel.getInstance().IntGradeToStr(item_data.summondata.grade); // info.FindChild("type").GetComponent<Text>().text = A3_SummonModel.getInstance().IntNaturalToStr(item_data.summondata.naturaltype); //} private void initItemDetail() { Transform info = transform.FindChild("details/info"); info.FindChild("name").GetComponent <Text>().text = item_data.summondata.name; info.FindChild("name").GetComponent <Text>().color = Globle.getColorByQuality(item_data.summondata.grade + 1); info.FindChild("basic/left/lv").GetComponent <Text>().text = ContMgr.getCont("a3_summon12") + item_data.summondata.level; //info.FindChild("basic/left/blood").GetComponent<Text>().text = ContMgr.getCont("a3_summon13") + (item_data.summondata.blood > 1 ? ContMgr.getCont("a3_summon14") : ContMgr.getCont("a3_summon15")); var spestr = item_data.summondata.isSpecial ? ContMgr.getCont("a3_summon16") + "*" : ""; // info.FindChild("basic/left/grade").GetComponent<Text>().text = ContMgr.getCont("a3_summon25") + A3_SummonModel.getInstance().IntGradeToStr(item_data.summondata.grade); info.FindChild("basic/right/lifespan").GetComponent <Text>().text = ContMgr.getCont("a3_summon7") + ":" + item_data.summondata.lifespan; info.FindChild("basic/right/luck").GetComponent <Text>().text = ContMgr.getCont("a3_summon27") + item_data.summondata.luck; //info.FindChild("basic/right/type").GetComponent<Text>().text = ContMgr.getCont("a3_summon17") + A3_SummonModel.getInstance().IntNaturalToStr(item_data.summondata.naturaltype); info.FindChild("natural/values/1").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon0") + item_data.summondata.attNatural; info.FindChild("natural/values/2").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon1") + item_data.summondata.defNatural; info.FindChild("natural/values/3").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon2") + item_data.summondata.agiNatural; info.FindChild("natural/values/4").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon3") + item_data.summondata.conNatural; info.FindChild("att/values/1").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon4") + item_data.summondata.maxhp; info.FindChild("att/values/2").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon5") + item_data.summondata.min_attack + " ~ " + item_data.summondata.max_attack; info.FindChild("att/values/3").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon6") + item_data.summondata.physics_def; info.FindChild("att/values/4").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon7") + item_data.summondata.magic_def; info.FindChild("att/values/5").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon8") + (float)item_data.summondata.physics_dmg_red / 10 + "%"; info.FindChild("att/values/6").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon9") + (float)item_data.summondata.magic_dmg_red / 10 + "%"; info.FindChild("att/values/7").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon10") + item_data.summondata.double_damage_rate; info.FindChild("att/values/8").GetComponent <Text>().text = ContMgr.getCont("a3tips_summon11") + item_data.summondata.reflect_crit_rate; var starRoot = info.FindChild("stars"); SetStar(starRoot, item_data.summondata.star); Transform Image = info.FindChild("icon"); if (Image.childCount > 0) { Destroy(Image.GetChild(0).gameObject); } GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(item_data); icon.transform.SetParent(Image, false); var SkillCon = this.transform.FindChild("skills"); for (int i = 0; i < SkillCon.childCount; i++) { SkillCon.GetChild(i).FindChild("icon/icon").gameObject.SetActive(false); SkillCon.GetChild(i).FindChild("lock").gameObject.SetActive(true); } int idner = 1; foreach (summonskill skill in item_data.summondata.skills.Values) { Transform skillCell = SkillCon.FindChild(idner.ToString()); skillCell.FindChild("icon/icon").gameObject.SetActive(true); skillCell.FindChild("lock").gameObject.SetActive(false); SXML xx = XMLMgr.instance.GetSXML("skill.skill", "id==" + skill.skillid); skillCell.FindChild("icon/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_smskill_" + xx.getInt("icon")); idner++; } }
public string getName() { if (tpid == 0) { return("<color=#ffd800>" + ContMgr.getCont("comm_money", count.ToString()) + "</color>"); } return(Globle.getColorStrByQuality(itemXml.getString("item_name"), itemXml.getInt("quality"))); }
void initItemBuy() { var objsurebuy = transform.FindChild("buy"); var surebuy_name = objsurebuy.transform.FindChild("bg/contain/name").GetComponent <Text>(); var surebuy_des = objsurebuy.transform.FindChild("bg/contain/des_bg/Text").GetComponent <Text>(); GameObject icon = objsurebuy.transform.FindChild("bg/contain/icon").gameObject; if (icon.transform.childCount > 0) { for (int i = 0; i < icon.transform.childCount; i++) { Destroy(icon.transform.GetChild(i).gameObject); } } GameObject item = IconImageMgr.getInstance().createA3ItemIcon(item_data); item.transform.SetParent(icon.transform, false); surebuy_name.text = a3_BagModel.getInstance().getItemDataById((uint)item_data.confdata.tpid).item_name; int color = a3_BagModel.getInstance().getItemDataById((uint)item_data.confdata.tpid).quality; surebuy_name.color = Globle.getColorByQuality(color); surebuy_des.text = a3_BagModel.getInstance().getItemDataById((uint)item_data.confdata.tpid).desc; foreach (var v in Shop_a3Model.getInstance().itemsdic.Values) { if (v.itemid == (int)item_data.confdata.tpid) { sd = v; } } bar.numberOfSteps = (int)PlayerModel.getInstance().gold / sd.value; maxnum = bar.numberOfSteps; if (maxnum <= 0) { bs_bt1.interactable = false; bs_bt2.interactable = false; bs_buy.interactable = false; bs_buy.onClick = (GameObject go) => flytxt.instance.fly(ContMgr.getCont("a3_dyetip")); return; } else { buynum = 1; totalMoney.text = (buynum * sd.value).ToString(); bar.value = (float)buynum / (float)maxnum; } bs_buy.onClick = delegate(GameObject goo) { if (sd == null) { return; } if (buynum >= 1) { Shop_a3Proxy.getInstance().sendinfo(2, sd.id, buynum); } }; }
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); } } }
//刷新属性 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); } }
public string getDropItemName() { if (tpid == 0) { return(ContMgr.getCont("comm_money", count.ToString())); } //string strGod = a3_BagModel.getInstance().addGodStr(itemXml.getInt("equip_level")); return(Globle.getColorStrByQuality(itemXml.getString("item_name"), itemXml.getInt("quality"))); }
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); }
private void onErrorRes(Variant data) { int res = data["res"]; if (res < 0) { Globle.err_output(res); } }
private void onActive(Variant data) { debug.Log("奖励信息:" + data.dump()); int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); } else { switch (num) { case 0: this.setClose(data); break; case 1: this.setWelfare(data); break; case 2: this.setGetFirstRechargeAward(data); break; case 3: this.setOnlineTime(data); break; case 4: this.setTotalLoginAward(data); break; case 5: this.setLvlAward(data); break; case 6: this.setAccumulateRecharge(data); break; case 7: this.setAccumulateConsumption(data); break; case 8: this.setDayRechargeAward(data); break; case 9: this.setTotalData(data); break; } } }
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); } } }
void onBuyTime(Variant data) { int res = data["res"]; if (res != 1) { Globle.err_output(res); return; } }
private void onBuyTime(Variant data) { int num = data["res"]; bool flag = num != 1; if (flag) { Globle.err_output(num); } }
private void onHttpCallback(string str) { bool flag = this.curTransing == null; if (flag) { this.curTransing = null; this.getCardsCode(); } else { bool flag2 = str == ""; if (flag2) { this.curTransing = null; this.getCardsCode(); } else { Variant variant = JsonManager.StringToVariant(str, true); bool flag3 = variant["r"] == 1; if (flag3) { debug.Log(string.Concat(new object[] { "获得激活码:", this.curTransing.id, " ", str })); GiftCardData giftCardData = new GiftCardData(); giftCardData.id = this.curTransing.id; giftCardData.code = variant["res"]; giftCardData.cardType = this.curTransing; giftCardData.initTimer(); bool flag4 = this.dGiftCardData.ContainsKey(giftCardData.id); if (flag4) { GiftCardData item = this.dGiftCardData[giftCardData.id]; this.lGiftCards.Remove(item); } this.dGiftCardData[giftCardData.id] = giftCardData; this.lGiftCards.Add(giftCardData); debug.Log("lGiftCards.clount::" + this.lGiftCards.Count); } else { Globle.err_output(variant["r"]); debug.Log("激活码领取的错误码:" + variant["r"]); } this.curTransing = null; this.getCardsCode(); } } }
public void OnWings(Variant data) { debug.Log("wing::" + data.dump()); int res = data["res"]; switch (res) { case 1: ModelBase <A3_WingModel> .getInstance().InitWingInfo(data); break; case 2: ModelBase <A3_WingModel> .getInstance().SetLevelExp(data); base.dispatchEvent(GameEvent.Create(0u, this, data, false)); break; case 3: { ModelBase <A3_WingModel> .getInstance().SetStageInfo(data); bool stageUp = ModelBase <A3_WingModel> .getInstance().stageUp; if (stageUp) { base.dispatchEvent(GameEvent.Create(1u, this, data, false)); ModelBase <A3_WingModel> .getInstance().SetShowStage(data); base.dispatchEvent(GameEvent.Create(3u, this, data, false)); } else { base.dispatchEvent(GameEvent.Create(4u, this, data, false)); } break; } case 4: ModelBase <A3_WingModel> .getInstance().SetLevelExp(data); base.dispatchEvent(GameEvent.Create(2u, this, data, false)); break; case 5: ModelBase <A3_WingModel> .getInstance().SetShowStage(data); base.dispatchEvent(GameEvent.Create(3u, this, data, false)); break; default: Globle.err_output(res); break; } }
private void S2CHandle(Variant s2cData) { int res = s2cData["res"];; //Debug.LogError( "==============坐骑消息" + s2cData.dump().ToString() ); switch (res) { case ( int )S2Cenum.RIDE_INFO: A3_RideModel.getInstance().SetRideInfoS2cData(s2cData); break; case ( int )S2Cenum.RIDE_UPGRADE: A3_RideModel.getInstance().ChangeRideLvlS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_UPGRADE, this, s2cData)); break; case ( int )S2Cenum.RIDE_UPGRADEGIFT: A3_RideModel.getInstance().ChangRideGiftLvlS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_UPGRADEGIFT, this, s2cData)); break; case ( int )S2Cenum.RIDE_UPDOWN: A3_RideModel.getInstance().ChangeRideStateS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_UPDOWN, this, s2cData)); Debug.LogError(s2cData.getValue("mount")._uint == 0 ? "下坐骑" : "上坐骑"); break; case ( int )S2Cenum.RIDE_CHANGE: A3_RideModel.getInstance().ChangeRideDressS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_CHANGE, this, s2cData)); if (s2cData.ContainsKey("lock_dress")) { dispatchEvent(GameEvent.Create((int)S2Cenum.RIDE_LIMIT, this, s2cData)); // 限时过期 } break; case ( int )S2Cenum.RIDE_ADD: A3_RideModel.getInstance().AddRideDressS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_ADD, this, s2cData)); break; case ( int )S2Cenum.RIDE_GIFTPOINT: break; default: Globle.err_output(res); break; } }
void onPlayerAddPoint(Variant msgData) { int res = msgData["res"]; if (res < 0) { Globle.err_output(res); return; } dispatchEvent(GameEvent.Create(EVENT_ADD_POINT, this, msgData)); }