public override void onAddNewSmallWin(string name) { switch (name) { case "uilayer_savecon": GameObject saveCon = getSummonWin()?.GetSmallWin(name); saveCon.transform.FindChild("Text_top").GetComponent <Text>().text = ContMgr.getCont("savecon_0"); saveCon.transform.FindChild("no/Text").GetComponent <Text>().text = ContMgr.getCont("savecon_2"); saveCon.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("ToSure_summon_1"); new BaseButton(saveCon.transform.FindChild("no")).onClick = new BaseButton(saveCon.transform.FindChild("tach")).onClick = (GameObject go) => { saveCon.SetActive(false); }; new BaseButton(saveCon.transform.FindChild("yes")).onClick = (GameObject go) => { if (curtype_do == Todo_type.tosave) { A3_SummonProxy.getInstance().sendXilian_save(CurSummonID); } else if (curtype_do == Todo_type.tochange) { A3_SummonProxy.getInstance().sendXilian(CurSummonID); } saveCon.SetActive(false); }; break; } }
public override void onClose() { A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_INSUMMON, onNewSum); A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_SHOWIDENTIFYANSWER, onGetSum); SetDispose(); curSumid = 0; }
public override void onShowed() { //refreView(); A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_SHOUHUN, onShouhun); setcurtype(1, true); setshouhun_lvl(); }
void SetView() { Transform Con = tranObj.transform.FindChild("View/scroll/content"); shouhunObj.Clear(); for (int i = 0; i < Con.childCount; i++) { GameObject.Destroy(Con.GetChild(i).gameObject); } GameObject item = tranObj.transform.FindChild("View/scroll/0").gameObject; List <SXML> SoulList = sumXml.GetNodeList("mon_soul"); foreach (SXML Soul in SoulList) { GameObject clon = GameObject.Instantiate(item) as GameObject; clon.SetActive(true); clon.transform.SetParent(Con, false); clon.transform.FindChild("name").GetComponent <Text>().text = Soul.getString("name"); int soulid = Soul.getInt("soul_id"); new BaseButton(clon.transform.FindChild("todo")).onClick = (GameObject go) => { A3_SummonProxy.getInstance().sendshouhun(CurSummonID, (uint)soulid, 1); }; int itemid = Soul.getInt("item_id"); a3_ItemData data = a3_BagModel.getInstance().getItemDataById((uint)itemid); GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data); icon.SetActive(true); icon.transform.SetParent(clon.transform.FindChild("todo/icon"), false); shouhunObj[soulid] = clon; } }
public override void onClosed() { this.transform.FindChild("btn_stone/cnt").gameObject.SetActive(true); this.transform.FindChild("btn_stone/icon").gameObject.SetActive(true); this.transform.FindChild("btn_gld/cnt").gameObject.SetActive(true); this.transform.FindChild("btn_gld/icon").gameObject.SetActive(true); this.transform.FindChild("btn_gld/Text").gameObject.SetActive(true); this.transform.FindChild("btn_gld/Text").gameObject.SetActive(true); InterfaceMgr.getInstance().floatUI.localScale = Vector3.one; if (GameObject.Find("GAME_CAMERA/myCamera")) { GameObject cameraOBJ = GameObject.Find("GAME_CAMERA/myCamera"); if (cameraOBJ.GetComponent <DeathShader>()) { cameraOBJ.GetComponent <DeathShader>().enabled = false; } } instans = null; if (A3_SummonModel.getInstance().GetSummons().ContainsKey(A3_SummonModel.getInstance().toAttackID)) { A3_SummonProxy.getInstance().sendChuzhan(A3_SummonModel.getInstance().toAttackID); A3_SummonModel.getInstance().toAttackID = 0; } }
public override void onShowed() { tishi.SetActive(false); helpcon.SetActive(false); A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_TUNSHI, onTunshi); showCurSummon(); setAvator(); }
void refreshShow(a3_BagItemData data) { Transform Image = this.transform.FindChild("bg/icon"); if (Image.childCount > 0) { for (int i = 0; i < Image.childCount; i++) { Destroy(Image.GetChild(i).gameObject); } } GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data); icon.transform.SetParent(Image, false); new BaseButton(this.transform.FindChild("bg/do")).onClick = (GameObject go) => { if (data.isEquip) { EquipProxy.getInstance().sendChangeEquip(data.id); } else if (data.confdata.use_type == 13) { a3_BagModel.getInstance().useItemByTpid(data.confdata.tpid, 1); } else if (data.confdata.use_type == 20)//宠物在开启功能之前获得 { if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET)) { a3_BagModel.getInstance().useItemByTpid(data.confdata.tpid, 1); } else { flytxt.instance.fly(ContMgr.getCont("func_limit_8")); } } else if (data.isSummon) { A3_SummonProxy.getInstance().sendUseSummon((uint)data.id); } }; new BaseButton(this.transform.FindChild("bg/close")).onClick = (GameObject go) => { if (data.isEquip) { a3_BagModel.getInstance().neweqp.Remove(data.id); } else if (data.confdata.use_type == 13 || data.confdata.use_type == 20) { a3_BagModel.getInstance().newshow_item.Remove(data.id); } else if (data.isSummon) { a3_BagModel.getInstance().newshow_summon.Remove(data.id); } showUse(); }; }
public override void onShowed() { A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_REFLIANXIE, onlianxie); A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_LINK, onlink); CloselianxieCon(); helpcon.SetActive(false); setInfo(); setlianxie_Value(); useItem_num(); }
public override void onShowed() { A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_XILIAN, onXilain); A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_SAVE, onsave); helpcon.SetActive(false); SetCurSuminfo(); SetNeedItem(); SetNewSumInfo(); curtype_do = Todo_type.nul; closeWin("uilayer_savecon"); }
public override void onClosed() { disposeAvatar(); A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_SUMINFO, GetInfo); InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL); GRMap.GAME_CAMERA.SetActive(true); if (a3_ranking.isshow && a3_ranking.isshow.Toback) { InterfaceMgr.getInstance().close(InterfaceMgr.A3_RANKING); } }
public void refresh_sumCd(float time) { sum_cd.fillAmount = time / 20f; sum_cd.transform.FindChild("time").GetComponent <Text>().text = ((int)time).ToString(); if (time <= 0) { sum_cd.gameObject.SetActive(false); do_sum_CD = false; A3_SummonProxy.getInstance().sendChuzhan(A3_SummonModel.getInstance().lastatkID); } }
void setSure(GameObject pre) { new BaseButton(pre.transform.FindChild("yes")).onClick = (GameObject go) => { if (A3_SummonModel.getInstance().GetSummons().ContainsKey(fuSumID)) { A3_SummonProxy.getInstance().sendRonghe(CurSummonID, fuSumID); pre.SetActive(false); } }; pre.transform.FindChild("top").GetComponent <Text>().text = ContMgr.getCont("summon_sure_top_1"); pre.transform.FindChild("txt").GetComponent <Text>().text = StringUtils.formatText(ContMgr.getCont("summon_sure_text_1")); }
public override void onShowed() { A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_RONGHE, onRonghe); SetCurSumInfo(); fuSumID = 0; closeWin("uilayer_tofusum_summon"); tranObj.transform.FindChild("fu/info").gameObject.SetActive(false); tranObj.transform.FindChild("fu/Button").gameObject.SetActive(true); setNullFuSkill(); setGailvAndNeedMoney(true); }
public override void onShowed() { A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_INSUMMON, onNewSum); A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_SHOWIDENTIFYANSWER, onGetSum); if (select_tujian > 0) { SetFristSelect(select_tujian); select_tujian = -1; } else { SetFristSelect(); } }
public override void onShowed() { A3_SummonProxy.getInstance().addEventListener(A3_SummonProxy.EVENT_SUMINFO, GetInfo); uint tid = 0; if (uiData != null && uiData.Count > 0) { tid = (uint)uiData[0]; } else { tid = SelfRole._inst.m_LockRole.m_unCID; } A3_SummonProxy.getInstance().sendgetinfo(tid); this.transform.SetAsLastSibling(); GRMap.GAME_CAMERA.SetActive(false); transform.FindChild("ig_bg_bg").gameObject.SetActive(false); InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FUNCTIONBAR); }
public void ongetsum(a3_BagItemData data) { GameObject plan = getSummonWin().GetSmallWin("uilayer_getsummon"); plan.SetActive(true); setGetAvator(data.summondata.tpid); setinfo_look(data, plan); new BaseButton(plan.transform.FindChild("use")).onClick = (GameObject go) => { if (A3_SummonModel.getInstance().GetSummons().Count >= A3_SummonModel.getInstance().allcount) { flytxt.instance.fly(ContMgr.getCont("a3_summon_liebiaoyiman")); } else { A3_SummonProxy.getInstance().sendUseSummon((uint)data.id); } plan.SetActive(false); if (getSummonWin().avator_look != null) { GameObject.Destroy(getSummonWin().avator_look); } if (getSummonWin().avatorobj&& !getSummonWin().avatorobj.activeSelf) { getSummonWin().avatorobj.SetActive(true); } }; new BaseButton(plan.transform.FindChild("putbag")).onClick = (GameObject go) => { flytxt.instance.fly(ContMgr.getCont("a3_summon_putbag")); plan.SetActive(false); if (getSummonWin().avator_look != null) { GameObject.Destroy(getSummonWin().avator_look); } if (getSummonWin().avatorobj&& !getSummonWin().avatorobj.activeSelf) { getSummonWin().avatorobj.SetActive(true); } }; }
void setSure(GameObject pre) { if (getSummonWin().avatorobj != null) { getSummonWin().avatorobj.SetActive(false); } new BaseButton(pre.transform.FindChild("yes")).onClick = (GameObject go) => { if (A3_SummonModel.getInstance().GetSummons().ContainsKey(FuSum_Id)) { A3_SummonProxy.getInstance().sendtunshi(CurSummonID, FuSum_Id); pre.SetActive(false); if (getSummonWin().avatorobj != null) { getSummonWin().avatorobj.SetActive(true); } } }; pre.transform.FindChild("top").GetComponent <Text>().text = ContMgr.getCont("summon_sure_top_2"); pre.transform.FindChild("txt").GetComponent <Text>().text = StringUtils.formatText(ContMgr.getCont("summon_sure_text_2")); }
void init() { r1 = tranObj.transform.FindChild("r1").gameObject; r2 = tranObj.transform.FindChild("r2").gameObject; attCon = r2.transform.FindChild("attcon"); new BaseButton(tranObj.transform.FindChild("r1/getbtn")).onClick = (GameObject go) => { if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID)) { return; } if (CurSummonID == A3_SummonModel.getInstance().nowShowAttackID) { flytxt.instance.fly(ContMgr.getCont("a3_summon3")); return; } a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID]; if (data.summondata.linkdata == null) { return; } bool cando = false; foreach (link_data dx in data.summondata.linkdata.Values) { if (dx.lock_state == false) { cando = true; break; } } if (cando) { if (getSummonWin() == null) { return; } GameObject toSrue = getSummonWin().GetSmallWin("uilayer_getlianxie"); toSrue.SetActive(true); } else { flytxt.instance.fly(ContMgr.getCont("a3_summon_lianxie_alllock")); } }; helpcon = tranObj.transform.FindChild("r1/help").gameObject; new BaseButton(tranObj.transform.FindChild("r1/help_btn")).onClick = (GameObject go) => { helpcon.SetActive(true); }; new BaseButton(helpcon.transform.FindChild("close")).onClick = (GameObject go) => { helpcon.SetActive(false); }; new BaseButton(r1.transform.FindChild("lianxieCon_btn")).onClick = (GameObject go) => { if (!CheckSummon()) { flytxt.instance.fly(ContMgr.getCont("nullsummon_link")); return; } OpenlianxieCon(); }; new BaseButton(r2.transform.FindChild("close")).onClick = (GameObject go) => { CloselianxieCon(); }; new BaseButton(r2.transform.FindChild("Battle")).onClick = (GameObject go) => { if (A3_SummonModel.getInstance().link_list.Count < 10) { List <uint> ids = new List <uint>(); if (A3_SummonModel.getInstance().link_list.Contains(CurSummonID)) { return; } ids.AddRange(A3_SummonModel.getInstance().link_list); ids.Add(CurSummonID); A3_SummonProxy.getInstance().sendlink(ids); } else { flytxt.instance.fly(ContMgr.getCont("maxnum")); } }; new BaseButton(r2.transform.FindChild("cancel")).onClick = (GameObject go) => { List <uint> ids = new List <uint>(); if (!A3_SummonModel.getInstance().link_list.Contains(CurSummonID)) { return; } ids.AddRange(A3_SummonModel.getInstance().link_list); ids.Remove(CurSummonID); A3_SummonProxy.getInstance().sendlink(ids); }; new BaseButton(r2.transform.FindChild("onekey")).onClick = (GameObject go) => { List <link_info> dic = new List <link_info>(); List <uint> idslist = new List <uint>(); foreach (a3_BagItemData it in A3_SummonModel.getInstance().GetSummons().Values) { bool can = false; foreach (int idx in it.summondata.linkdata.Keys) { if (it.summondata.linkdata[idx].type != 0) { can = true; break; } } if (!can) { continue; } link_info l = new link_info(); l.id = (uint)it.summondata.id; l.combpt = it.summondata.linkCombpt; dic.Add(l); } dic.Sort(); int ids = 1; foreach (link_info com in dic) { idslist.Add(com.id); ids++; if (ids > 10) { break; } } A3_SummonProxy.getInstance().sendlink(idslist); }; inText(); }
public override void onClose() { A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_TUNSHI, onTunshi); SetDispose(); FuSum_Id = 0; }
void init() { tranObj.transform.FindChild("bg/bg/Text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_shouhun_0"); tranObj.transform.FindChild("info/att/Text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_shouhun_1"); tranObj.transform.FindChild("info/nextatt/Text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_shouhun_2"); tranObj.transform.FindChild("info/go/Text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_shouhun_3"); tranObj.transform.FindChild("info/onekeygo/Text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_shouhun_4"); con = tranObj.transform.FindChild("View/scroll/content"); for (int i = 1; i <= con.childCount; i++) { soulObj[i] = con.FindChild(i.ToString()).gameObject; int tp = i; new BaseButton(soulObj[tp].transform).onClick = (GameObject go) => { setcurtype(tp); }; } new BaseButton(tranObj.transform.FindChild("info/go")).onClick = (GameObject go) => { A3_SummonProxy.getInstance().sendshouhun(CurSummonID, (uint)curtype, 1); a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID]; if (!data.summondata.shouhun.ContainsKey(curtype)) { return; } SXML Soulxml = sumXml.GetNode("mon_soul", "soul_id==" + curtype); int itemid = Soulxml.getInt("item_id"); if (a3_BagModel.getInstance().getItemNumByTpid((uint)itemid) <= 0) { if (XMLMgr.instance.GetSXML("item.item", "id==" + itemid).GetNode("drop_info") == null) { return; } ArrayList data1 = new ArrayList(); data1.Add(a3_BagModel.getInstance().getItemDataById((uint)itemid)); data1.Add(InterfaceMgr.A3_SUMMON_NEW); if (getSummonWin().avatorobj != null) { data1.Add(getSummonWin().avatorobj); } else { data1.Add(null); } ArrayList n = new ArrayList(); n.Add("shouhun"); data1.Add(n); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1); } }; new BaseButton(tranObj.transform.FindChild("info/onekeygo")).onClick = (GameObject go) => { if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID)) { return; } a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID]; if (!data.summondata.shouhun.ContainsKey(curtype)) { return; } SXML Soulxml = sumXml.GetNode("mon_soul", "soul_id==" + curtype); int itemid = Soulxml.getInt("item_id"); a3_ItemData item_data = a3_BagModel.getInstance().getItemDataById((uint)itemid); int itemcount_all = a3_BagModel.getInstance().getItemNumByTpid((uint)itemid); if (itemcount_all <= 0) { if (XMLMgr.instance.GetSXML("item.item", "id==" + itemid).GetNode("drop_info") == null) { return; } ArrayList data1 = new ArrayList(); data1.Add(a3_BagModel.getInstance().getItemDataById((uint)itemid)); data1.Add(InterfaceMgr.A3_SUMMON_NEW); if (getSummonWin().avatorobj != null) { data1.Add(getSummonWin().avatorobj); } else { data1.Add(null); } ArrayList n = new ArrayList(); n.Add("shouhun"); data1.Add(n); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1); flytxt.instance.fly(ContMgr.getCont("a3_summon_shouhun_noitem")); return; } int curlvl = data.summondata.shouhun[curtype].lvl; int curExp = data.summondata.shouhun[curtype].exp; int maxlvl = sumXml.GetNodeList("mon_soul_exp").Count; int needExp = 0; for (int i = curlvl + 1; i <= maxlvl; i++) { needExp += sumXml.GetNode("mon_soul_exp", "lvl==" + i).getInt("need_exp"); } needExp -= curExp; int needItemCount = 0; int useExp = item_data.main_effect; if (needExp % useExp > 0) { needItemCount = (needExp / useExp) + 1; } else { needItemCount = needExp / useExp; } if (itemcount_all >= needItemCount) { A3_SummonProxy.getInstance().sendshouhun(CurSummonID, (uint)curtype, (uint)needItemCount); } else { A3_SummonProxy.getInstance().sendshouhun(CurSummonID, (uint)curtype, (uint)itemcount_all); } }; //SetView(); }
private void onuse(GameObject go) { debug.Log("Use Item"); InterfaceMgr.getInstance().close(InterfaceMgr.A3TIPS_SUMMON); A3_SummonProxy.getInstance().sendUseSummon((uint)item_data.id); }
public override void onShowed() { closeWindow(); instans = this; this.transform.FindChild("btn_gld/Text_free").gameObject.SetActive(false); this.transform.FindChild("btn_stone/Text_free").gameObject.SetActive(false); recharge.SetActive(false); InterfaceMgr.getInstance().floatUI.localScale = Vector3.zero; if (GameObject.Find("GAME_CAMERA/myCamera")) { GameObject cameraOBJ = GameObject.Find("GAME_CAMERA/myCamera"); if (!cameraOBJ.GetComponent <DeathShader>()) { cameraOBJ.AddComponent <DeathShader>(); } else { cameraOBJ.GetComponent <DeathShader>().enabled = true; } } //timer = 0; //origin_tm = 3; here_time = 30; jdzc_time = Xml_jdzc.getInt("revive"); btn_gld.gameObject.SetActive(false); btn_stone.gameObject.SetActive(false); btn_backleft.gameObject.SetActive(false); btn_backmid.gameObject.SetActive(false); spost_relive.gameObject.SetActive(false); //btn_stone.interactable = false; //btn_gld.interactable = false; //btn_backmid.interactable = false; //btn_backleft.interactable = false; RefreshBackTownBtn(); if (!PlayerModel.getInstance().inFb) { RefreshOriginBtn(); } if (CanReviveOrigin() == 0) {//地图不允许原地复活 btn_backmid.gameObject.SetActive(true); } else if (CanReviveOrigin() == 1) { if (HasRespawnStone()) { btn_stone.gameObject.SetActive(true); btn_backleft.gameObject.SetActive(true); } else { btn_gld.gameObject.SetActive(true); btn_backleft.gameObject.SetActive(true); } } else if (CanReviveOrigin() == 3) { //不可复活,自动本场景复活点复活 spost_relive.gameObject.SetActive(true); } // BattleProxy.getInstance().addEventListener(BattleProxy.EVENT_DIE, refInfo); if (uiData != null) { one = (BaseRole)uiData[0]; } refInfo(); InterfaceMgr.getInstance().closeAllWin(InterfaceMgr.A3_RELIVE); if (A3_SummonModel.getInstance().GetSummons().ContainsKey(A3_SummonModel.getInstance().nowShowAttackID)) { A3_SummonModel.getInstance().toAttackID = A3_SummonModel.getInstance().nowShowAttackID; A3_SummonProxy.getInstance().sendZhaohui(); } NewbieModel.getInstance().hide(); }
public override void onClose() { A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_SHOUHUN, onShouhun); //SetDispose(); }
private void on_sprite_invisible(Variant msgData) { debug.Log("on_sprite_invisible::" + msgData.dump()); uint iid = msgData["iid"]._uint; //uint m_unCID = 0; bool invisible = msgData["invisible"] > 0; if (iid == SelfRole._inst.m_unIID) { SelfRole._inst.invisible = invisible; if (a1_gamejoy.inst_skillbar != null) { a1_gamejoy.inst_skillbar.forSkill_5008(invisible); } isyinsh = invisible; SelfRole._inst.refreshmapCount((int)PlayerModel.getInstance().treasure_num); SelfRole._inst.refreshVipLvl((uint)A3_VipModel.getInstance().Level); //m_unCID = PlayerModel.getInstance().cid; if (A3_SummonModel.getInstance().nowShowAttackID != 0 && invisible) { A3_SummonProxy.getInstance().sendZhaohui(); } else if (A3_SummonModel.getInstance().nowShowAttackID != 0 && A3_SummonModel.getInstance().lastSummonID != 0 && invisible == false) { if (A3_SummonModel.getInstance().getSumCds().ContainsKey(( int )A3_SummonModel.getInstance().lastSummonID)) { flytxt.instance.fly(ContMgr.getCont("a3_summon10")); } else { A3_SummonProxy.getInstance().sendChuzhan(A3_SummonModel.getInstance().lastSummonID); } } //隐身状态下 把召唤兽 收回 } else { ProfessionRole pr = OtherPlayerMgr._inst.GetOtherPlayer(iid); if (pr != null) { pr.invisible = invisible; if (invisible && SelfRole._inst.m_LockRole == pr) { SelfRole._inst.m_LockRole = null; } if (pr.invisible == false && pr.dianjiTime == -1 && pr.isUp == false) { pr.ChangeRideState(true); } } //m_unCID = pr.m_unCID; } //uint monsterIID = 0; //if ( MonsterMgr._inst.roleSummonMapping.ContainsKey( m_unCID ) ) //{ // monsterIID = MonsterMgr._inst.roleSummonMapping[ m_unCID ]; // 召唤兽iid //} //if ( monsterIID != null && MonsterMgr._inst.m_mapMonster.ContainsKey( monsterIID ) ) //{ // var monster = MonsterMgr._inst.m_mapMonster[ monsterIID ]; // if ( monster is MS0000 ) // { // ( monster as MS0000 ).invisibleState = invisible ; // } //} }
public override void onClose() { A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_REFLIANXIE, onlianxie); A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_LINK, onlink); CloselianxieCon(); }
public override void onAddNewSmallWin(string name) { switch (name) { case "uilayer_getlianxie": GameObject getlianxie = getSummonWin()?.GetSmallWin(name); getlianxie.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_getlianxie_1"); getlianxie.transform.FindChild("no/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_getlianxie_2"); getlianxie.transform.FindChild("Text_mian").GetComponent <Text>().text = ContMgr.getCont("uilayer_getlianxie_3"); new BaseButton(getlianxie.transform.FindChild("yes/Text")).onClick = (GameObject go) => { if (CanGet) { A3_SummonProxy.getInstance().sendlianxie(CurSummonID); } else { if (XMLMgr.instance.GetSXML("item.item", "id==" + NeedItem_lianxie).GetNode("drop_info") == null) { return; } ArrayList data1 = new ArrayList(); data1.Add(a3_BagModel.getInstance().getItemDataById((uint)NeedItem_lianxie)); data1.Add(InterfaceMgr.A3_SUMMON_NEW); if (getSummonWin().avatorobj != null) { data1.Add(getSummonWin().avatorobj); } else { data1.Add(null); } ArrayList n = new ArrayList(); n.Add("lianxie"); data1.Add(n); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1); } getlianxie.SetActive(false); }; new BaseButton(getlianxie.transform.FindChild("tach")).onClick = new BaseButton(getlianxie.transform.FindChild("no/Text")).onClick = (GameObject go) => { getlianxie.SetActive(false); }; break; case "uilayer_addlianxie": GameObject addlianxie = getSummonWin()?.GetSmallWin(name); addlianxie.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_addlianxie_1"); addlianxie.transform.FindChild("no/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_addlianxie_2"); addlianxie.transform.FindChild("Text_mian").GetComponent <Text>().text = ContMgr.getCont("uilayer_addlianxie_3"); new BaseButton(addlianxie.transform.FindChild("yes/Text")).onClick = (GameObject go) => { if (CanAdd) { A3_SummonProxy.getInstance().sendaddlx(CurSummonID); } else { if (XMLMgr.instance.GetSXML("item.item", "id==" + AddlianxieId).GetNode("drop_info") == null) { return; } ArrayList data1 = new ArrayList(); data1.Add(a3_BagModel.getInstance().getItemDataById((uint)AddlianxieId)); data1.Add(InterfaceMgr.A3_SUMMON_NEW); if (getSummonWin().avatorobj != null) { data1.Add(getSummonWin().avatorobj); } else { data1.Add(null); } ArrayList n = new ArrayList(); n.Add("lianxie"); data1.Add(n); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1); } addlianxie.SetActive(false); }; new BaseButton(addlianxie.transform.FindChild("tach")).onClick = new BaseButton(addlianxie.transform.FindChild("no/Text")).onClick = (GameObject go) => { addlianxie.SetActive(false); }; for (int i = 0; i < addlianxie.transform.FindChild("icon").childCount; i++) { GameObject.Destroy(addlianxie.transform.FindChild("icon").GetChild(i).gameObject); } int itemid = sumXml.GetNode("link").getInt("add_link"); a3_ItemData itemdata = a3_BagModel.getInstance().getItemDataById((uint)itemid); GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(itemdata); icon.transform.SetParent(addlianxie.transform.FindChild("icon"), 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); }; break; case "uilayer_lock": GameObject locking = getSummonWin()?.GetSmallWin(name); locking.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_lock_1"); locking.transform.FindChild("no/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_lock_2"); locking.transform.FindChild("Text_mian").GetComponent <Text>().text = ContMgr.getCont("uilayer_lock_3"); new BaseButton(locking.transform.FindChild("yes/Text")).onClick = (GameObject go) => { if (CanLock) { A3_SummonProxy.getInstance().sendlocklx(CurSummonID, (uint)index, true); } else { if (XMLMgr.instance.GetSXML("item.item", "id==" + lockItem).GetNode("drop_info") == null) { return; } ArrayList data1 = new ArrayList(); data1.Add(a3_BagModel.getInstance().getItemDataById((uint)lockItem)); data1.Add(InterfaceMgr.A3_SUMMON_NEW); if (getSummonWin().avatorobj != null) { data1.Add(getSummonWin().avatorobj); } else { data1.Add(null); } ArrayList n = new ArrayList(); n.Add("lianxie"); data1.Add(n); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1); } locking.SetActive(false); }; new BaseButton(locking.transform.FindChild("tach")).onClick = new BaseButton(locking.transform.FindChild("no/Text")).onClick = (GameObject go) => { locking.SetActive(false); }; for (int i = 0; i < locking.transform.FindChild("icon").childCount; i++) { GameObject.Destroy(locking.transform.FindChild("icon").GetChild(i).gameObject); } int itemid2 = sumXml.GetNode("link").getInt("change_lock"); a3_ItemData itemdata2 = a3_BagModel.getInstance().getItemDataById((uint)itemid2); GameObject icon2 = IconImageMgr.getInstance().createA3ItemIcon(itemdata2); icon2.transform.SetParent(locking.transform.FindChild("icon"), false); new BaseButton(icon2.transform).onClick = (GameObject go) => { ArrayList arr = new ArrayList(); arr.Add((uint)itemid2); arr.Add(1); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr); }; break; case "uilayer_unlock": GameObject unlock = getSummonWin()?.GetSmallWin(name); unlock.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_unlock_1"); unlock.transform.FindChild("no/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_unlock_2"); unlock.transform.FindChild("Text_mian").GetComponent <Text>().text = ContMgr.getCont("uilayer_unlock_3"); new BaseButton(unlock.transform.FindChild("yes/Text")).onClick = (GameObject go) => { A3_SummonProxy.getInstance().sendlocklx(CurSummonID, (uint)index, false); unlock.SetActive(false); }; new BaseButton(unlock.transform.FindChild("tach")).onClick = new BaseButton(unlock.transform.FindChild("no/Text")).onClick = (GameObject go) => { unlock.SetActive(false); }; for (int i = 0; i < unlock.transform.FindChild("icon").childCount; i++) { GameObject.Destroy(unlock.transform.FindChild("icon").GetChild(i).gameObject); } int itemid1 = sumXml.GetNode("link").getInt("change_lock"); a3_ItemData itemdata1 = a3_BagModel.getInstance().getItemDataById((uint)itemid1); GameObject icon1 = IconImageMgr.getInstance().createA3ItemIcon(itemdata1); icon1.transform.SetParent(unlock.transform.FindChild("icon"), false); new BaseButton(icon1.transform).onClick = (GameObject go) => { ArrayList arr = new ArrayList(); arr.Add((uint)itemid1); arr.Add(1); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr); }; break; } }
public override void onStart(Variant svr) { base.onStart(svr); a3_insideui_fb.room = this; isOpen = true; data = MapModel.getInstance().getMapDta(9000); if (data == null) { data = new MapData(); } MapModel.getInstance().AddMapDta(9000, data); if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.updateUICseth(); } if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.refreshByUIState(); } Variant v = new Variant(); v["curLevelId"] = MapModel.getInstance().curLevelId; InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_map_ByUIState", "ui/interfaces/low/a1_low_fightgame", v); InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_btn_ByUIState", "ui/interfaces/low/a1_low_fightgame", v); InterfaceMgr.doCommandByLua("a1_low_fightgame.showbtnIcon", "ui/interfaces/low/a1_low_fightgame", false); InterfaceMgr.doCommandByLua("a1_high_fightgame.showbtnIcon", "ui/interfaces/high/a1_high_fightgame", false); entertimer = muNetCleint.instance.CurServerTimeStamp; a3_insideui_fb.begintime = entertimer; enterdata = muLGClient.instance.g_levelsCT.get_curr_lvl_info(); a3_insideui_fb.ShowInUI(a3_insideui_fb.e_room.JDZC); A3_SummonProxy.getInstance().sendZhaohui(); if (a3_expbar.instance) { a3_expbar.instance.showBtnIcon(false); } if (a3_liteMinimap.instance) { a3_liteMinimap.instance.showbtnIcon(false); } if (a1_gamejoy.inst_joystick) { a1_gamejoy.inst_joystick.show_btnIcon(false); } if (a3_herohead.instance) { a3_herohead.instance.showbtnIcon(false); } if (a3_equipup.instance) { a3_equipup.instance.showbtnIcom(false); } InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_LITEMINIBASEMAP); if (data != null) { data.cycleCount++; } }
public override void onClose() { A3_SummonProxy.getInstance().removeEventListener(A3_SummonProxy.EVENT_RONGHE, onRonghe); }
void onItemChange(Variant data) { debug.Log(data.dump() + ":::::::::::::::"); // Debug.LogError(a3_BagModel.getInstance().item_num[1540].num); if (data.ContainsKey("money") || data.ContainsKey("yb") || data.ContainsKey("bndyb")) {//金钱变化 if (data.ContainsKey("money")) { if (data["money"] > PlayerModel.getInstance().money) { //if(a3_insideui_fb.instance == null) flytxt.instance.fly(ContMgr.getCont("BagProxy_money") + (data["money"] - PlayerModel.getInstance().money)); if (a3_insideui_fb.instance != null && data.Count == 1) { a3_insideui_fb.instance.SetInfMoney((int)(data["money"] - PlayerModel.getInstance().money)); //BaseRoomItem.instance.goldnum = (data["money"] - PlayerModel.getInstance().money); //debug.Log("ssssssssssssssssssssssssddd+" + BaseRoomItem.instance.goldnum); } } else { debug.Log("消耗金币" + (PlayerModel.getInstance().money - data["money"])); skill_a3.upgold = (int)(PlayerModel.getInstance().money - data["money"]); } PlayerModel.getInstance().money = data["money"]; } if (data.ContainsKey("yb"))//钻石 { uint lastgold = PlayerModel.getInstance().gold; PlayerModel.getInstance().gold = data["yb"]; if (lastgold < data["yb"] && HttpAppMgr.instance != null && HttpAppMgr.instance.giftCard != null) { HttpAppMgr.instance.giftCard.getFirstRechangeCard(); HttpAppMgr.instance.giftCard.getRechangeCard(); } } if (data.ContainsKey("bndyb")) { PlayerModel.getInstance().gift = data["bndyb"]; } UIClient.instance.dispatchEvent(GameEvent.Create(UI_EVENT.ON_MONEY_CHANGE, this, data)); } bool new_itm = true; if (data.ContainsKey("new_itm")) { new_itm = data["new_itm"]; } if (data.ContainsKey("add")) { //a3_BagModel.getInstance().removetype(); int m = 0; Variant info = data["add"]; foreach (Variant item in info._arr) { a3_BagItemData itemData = new a3_BagItemData(); itemData.id = item["id"]; itemData.tpid = item["tpid"]; itemData.num = item["cnt"]; itemData.bnd = item["bnd"]; if (a3_BagModel.getInstance().Items.ContainsKey(item["id"])) { m = a3_BagModel.getInstance().Items[item["id"]].num; } if (item.ContainsKey("mark")) { itemData.ismark = item["mark"]; } itemData.isEquip = false; if (new_itm) { itemData.isNew = true; } else { itemData.isNew = false; } if (item.ContainsKey("stone_att")) { itemData.isrunestone = true; foreach (Variant i in item["stone_att"]._arr) { itemData.runestonedata.runeston_att = new Dictionary <int, int>(); int att_type = i["att_type"]; int att_value = i["att_value"]; itemData.runestonedata.runeston_att[att_type] = att_value; } } else { itemData.isrunestone = false; } if (item.ContainsKey("intensify_lv")) { a3_EquipModel.getInstance().equipData_read(itemData, item); } if (item.ContainsKey("talent")) { itemData.isSummon = true; itemData = A3_SummonModel.getInstance().GetSummonData(itemData, item); } a3_BagModel.getInstance().addItem(itemData); if (off_line_exp.instance != null) { if (off_line_exp.instance.offline == true) { off_line_exp.instance.offline_item.Add(itemData); if (off_line_exp.instance.fenjie.isOn == false) { flytxt.instance.fly(ContMgr.getCont("BagProxy_getequip") + a3_BagModel.getInstance().getItemXml(item["tpid"]).getString("item_name")); } else { flytxt.instance.fly(ContMgr.getCont("BagProxy_geteitem") + a3_BagModel.getInstance().getItemXml(item["tpid"]).getString("item_name") + "x" + (item["cnt"] - m)); } } } if (A3_SummonProxy.getInstance().getNewSum) { A3_SummonProxy.getInstance().getNewSum = false; //dispatchEvent(GameEvent.Create(EVENT_GET_SUM, this, item)); if (a3_summon_tujian.instans != null) { a3_summon_tujian.instans.ongetsum(itemData); } } //添加魔晶 //if (itemData.tpid == 1540) //{ // if (a3_expbar.instance != null) a3_expbar.instance.CheckNewSkill(); //} } //if (off_line_exp.instance?.offline == true) //{ // if (off_line_exp.instance.offline_item != null) // { // foreach (var v in off_line_exp.instance.offline_item) // { // a3_ItemData item = a3_BagModel.getInstance().getItemDataById((uint)v.tpid); // GameObject go = IconImageMgr.getInstance().createA3ItemIconTip(itemid: (uint)v.tpid, num: v.num); // flytxt.instance.fly(null, 6, showIcon: go); // } // } // off_line_exp.instance.offline = false; // off_line_exp.instance.offline_item.Clear(); //} if (a3_role.instan != null) { dispatchEvent(GameEvent.Create(EVENT_USE_DYE, this, data)); } } if (data.ContainsKey("modcnts")) { int m = 0; Variant info = data["modcnts"]; foreach (Variant item in info._arr) { a3_BagItemData itemData = new a3_BagItemData(); itemData.id = item["id"]; itemData.tpid = item["tpid"]; itemData.num = item["cnt"]; //itemData.bnd = item["bnd"]; itemData.isEquip = false; itemData.isNew = false; if (a3_BagModel.getInstance().Items.ContainsKey(item["id"])) { m = a3_BagModel.getInstance().Items[item["id"]].num; } // Debug.LogError(a3_BagModel.getInstance().Items[item["id"]].num + "sss" + a3_BagModel.getInstance().getItemNumByTpid(1540)+"ss"+ a3_BagModel.getInstance().getItems()[item["id"]].num); if (item.ContainsKey("intensify_lv")) { a3_EquipModel.getInstance().equipData_read(itemData, item); } int n = 0; if (a3_BagModel.getInstance().getItems().ContainsKey(itemData.id)) { n = a3_BagModel.getInstance().getItems()[itemData.id].num; } a3_BagModel.getInstance().addItem(itemData); if (item["tpid"] == 1540) { skill_a3.upmojing = a3_BagModel.getInstance().getItemNumByTpid(1540);//魔晶剩余总量 } if (off_line_exp.instance != null) { if (off_line_exp.instance.offline == true) { off_line_exp.instance.offline_item.Add(itemData); flytxt.instance.fly(ContMgr.getCont("BagProxy_geteitem") + a3_BagModel.getInstance().getItemXml(item["tpid"]).getString("item_name") + "x" + (item["cnt"] - m)); } } //修改魔晶 //if (itemData.tpid == 1540 && n < itemData.num) //{ // if (a3_expbar.instance != null) a3_expbar.instance.CheckNewSkill(); //} } } if (data.ContainsKey("rmvids")) { //a3_BagModel.getInstance().addtype(); Variant info = data["rmvids"]; foreach (uint id in info._arr) { a3_BagModel.getInstance().removeItem(id); } } if (data.ContainsKey("rmvids") || data.ContainsKey("add") || data.ContainsKey("modcnts")) { dispatchEvent(GameEvent.Create(EVENT_ITEM_CHANGE, this, data)); //if (a3_bag.indtans) { a3_bag.indtans.onItemChange(data); } if (isRanse) { dispatchEvent(GameEvent.Create(EVENT_USE_DYE, this, data)); isRanse = false; } } if (data.ContainsKey("nobpt")) {//声望点 if ((data["nobpt"] > PlayerModel.getInstance().nobpt)) { flytxt.instance.fly(ContMgr.getCont("BagProxy_nobpt") + (data["nobpt"] - PlayerModel.getInstance().nobpt)); } PlayerModel.getInstance().nobpt = data["nobpt"]; } if (data.ContainsKey("energy")) {//体力 MapModel.getInstance().energy = data["energy"]; //if (fb_3d.instance != null) // fb_3d.instance.refreshEnergy(); //if (fb_energy.instance != null) // fb_energy.instance.refresh(); } }
void setGetItem() { if (curSumid <= 0 || curStar <= 0) { return; } SXML xml = sumXml.GetNode("callbeast", "id==" + curSumid); SXML attxml = xml.GetNode("star", "star_sum==" + curStar); int itemid = attxml.getInt("get_type2_itm"); int num = attxml.getInt("get_type2_num"); if (itemid <= 0) { tranObj.transform.FindChild("need/GetNeed_1").gameObject.SetActive(false); } else { tranObj.transform.FindChild("need/GetNeed_1").gameObject.SetActive(true); a3_ItemData item = a3_BagModel.getInstance().getItemDataById((uint)itemid); GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(item); for (int i = 0; i < tranObj.transform.FindChild("need/GetNeed_1/itemicon").childCount; i++) { GameObject.Destroy(tranObj.transform.FindChild("need/GetNeed_1/itemicon").GetChild(i).gameObject); } icon.transform.SetParent(tranObj.transform.FindChild("need/GetNeed_1/itemicon"), 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); }; int haveCount = a3_BagModel.getInstance().getItemNumByTpid((uint)itemid); string str = ""; if (haveCount >= num) { str = "<color=#00FF56FF>" + haveCount + "/" + num + "</color>"; } else { str = "<color=#f90e0e>" + haveCount + "/" + num + "</color>"; } tranObj.transform.FindChild("need/GetNeed_1/count").GetComponent <Text>().text = str; tranObj.transform.FindChild("need/GetNeed_1/name").GetComponent <Text>().text = item.item_name; new BaseButton(tranObj.transform.FindChild("need/GetNeed_1/todo")).onClick = (GameObject go) => { //碎片兑换 A3_SummonProxy.getInstance().sendGetsummon((uint)curSumid, (uint)curStar, 2); }; } int num_item = attxml.getInt("get_type1"); if (num_item <= 0) { tranObj.transform.FindChild("need/GetNeed_2").gameObject.SetActive(false); } else { int itemId = attxml.getInt("info_itm"); tranObj.transform.FindChild("need/GetNeed_2").gameObject.SetActive(true); SXML s_xml = itemXml.GetNode("item", "id==" + itemId); string file = "icon_item_" + s_xml.getString("icon_file"); tranObj.transform.FindChild("need/GetNeed_2/itemicon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite(file); string file_bg = "icon_itemborder_b039_0" + (curStar - 1); tranObj.transform.FindChild("need/GetNeed_2/bg").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite(file_bg); string str = ""; int needitemId = xml.GetNode("star", "star_sum==" + (curStar - 1)).getInt("info_itm"); new BaseButton(tranObj.transform.FindChild("need/GetNeed_2/itemicon")).onClick = (GameObject go) => { ArrayList arr = new ArrayList(); arr.Add((uint)needitemId); arr.Add(1); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr); }; SXML s_xml_need = itemXml.GetNode("item", "id==" + needitemId); int havecount = a3_BagModel.getInstance().getItemNumByTpid((uint)needitemId); if (havecount >= num_item) { str = "<color=#00FF56FF>" + havecount + "/" + num_item + "</color>"; } else { str = "<color=#f90e0e>" + havecount + "/" + num_item + "</color>"; } tranObj.transform.FindChild("need/GetNeed_2/count").GetComponent <Text>().text = str; tranObj.transform.FindChild("need/GetNeed_2/name").GetComponent <Text>().text = s_xml_need.getString("item_name"); new BaseButton(tranObj.transform.FindChild("need/GetNeed_2/todo")).onClick = (GameObject go) => { //召唤兽兑换 Dictionary <uint, a3_BagItemData> items = a3_BagModel.getInstance().getItems(); List <uint> sums = new List <uint>(); foreach (a3_BagItemData data in items.Values) { if (data.isSummon) { if (data.tpid != curSumid) { continue; } if (data.summondata.star == (curStar - 1)) { sums.Add((uint)data.summondata.id); } } } if (sums.Count >= num_item) { List <uint> To_sums = new List <uint>(); for (int i = 0; i < num_item; i++) { To_sums.Add(sums[i]); } A3_SummonProxy.getInstance().sendGetsummon((uint)curSumid, (uint)curStar, 1, To_sums); } else { flytxt.instance.fly(ContMgr.getCont("a3_summon_duihuandaojubuzu")); } }; } }