void addLegion() { uint cid = SelfRole._inst.m_LockRole.m_unCID; A3_LegionProxy.getInstance().SendInvite(cid); hide(); }
override public void onClosed() { // 军团buff另加。监听事件EVENT_REMOVE A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_QUIT, Quit); // A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_REMOVE, Quit); A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_CREATE, Join); A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_DELETECLAN, Deleteclan); //宠物buff另加。监听事件 //A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_GET_PET, OpenPet);//得到宠物 A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.CHANGE_PET, changePet); //更换宠物 A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_HAVE_PET, closePet); //饲料到期 A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_GET_LAST_TIME, get_pettime); //购买饲料 BattleProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_GET_LAST_TIME, reshbuff); }
public override void init() { inText(); instance = this; #region ====主界面初始化==== ss = XMLMgr.instance.GetSXML("clan_escort"); listXml = ss.GetNodeList("line"); length = listXml.Count; for (int i = 0; i < length; i++) { clans cla = new clans(); cla.open_lv_clan = listXml[i].getInt("clan_lvl"); cla.pathid = listXml[i].getUint("id"); cla.target_map = listXml[i].getUint("target_map"); cla.add_money_num = listXml[i].getInt("clan_money"); cla.item_id = listXml[i].getUint("item_id"); cla.item_num = listXml[i].getInt("item_num"); if (!dicClan.ContainsKey(listXml[i].getInt("id"))) { dicClan.Add(listXml[i].getInt("id"), cla); } } one = dicClan[1].open_lv_clan; three = dicClan[2].open_lv_clan; five = dicClan[3].open_lv_clan; //Variant list = SvrMapConfig.instance.getSingleMapConf(dicClan[1].target_map); //getTransformByPath("candodart/scroll_view_dart/contain/UndergroundCity/bg/title").GetComponent<Text>().text = list["map_name"]; //list = SvrMapConfig.instance.getSingleMapConf(dicClan[2].target_map); //getTransformByPath("candodart/scroll_view_dart/contain/darkPalace/bg/title").GetComponent<Text>().text = list["map_name"]; //list = SvrMapConfig.instance.getSingleMapConf(dicClan[3].target_map); //getTransformByPath("candodart/scroll_view_dart/contain/coldWind/bg/title").GetComponent<Text>().text = list["map_name"]; string stri = "candodart/scroll_view_dart/contain"; List <SXML> lisx = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[1].item_id); item_id = dicClan[1].item_id; getTransformByPath(stri + "/UndergroundCity/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file")); getTransformByPath(stri + "/UndergroundCity/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1"); getTransformByPath(stri + "/UndergroundCity/award/1/Text").GetComponent <Text>().text = dicClan[1].add_money_num.ToString(); getTransformByPath(stri + "/UndergroundCity/award/2/Text").GetComponent <Text>().text = dicClan[1].item_num.ToString(); new BaseButton(getTransformByPath(stri + "/UndergroundCity/award/2")).onClick = (GameObject go) => { ArrayList arr = new ArrayList(); arr.Add(dicClan[1].item_id); arr.Add(1); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr); }; lisx = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[2].item_id); item_id = dicClan[2].item_id; getTransformByPath(stri + "/darkPalace/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file")); getTransformByPath(stri + "/darkPalace/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1"); getTransformByPath(stri + "/darkPalace/award/1/Text").GetComponent <Text>().text = dicClan[2].add_money_num.ToString(); getTransformByPath(stri + "/darkPalace/award/2/Text").GetComponent <Text>().text = dicClan[2].item_num.ToString(); new BaseButton(getTransformByPath(stri + "/darkPalace/award/2")).onClick = (GameObject go) => { ArrayList arr = new ArrayList(); arr.Add(dicClan[2].item_id); arr.Add(1); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr); }; lisx = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[3].item_id); item_id = dicClan[3].item_id; getTransformByPath(stri + "/coldWind/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file")); getTransformByPath(stri + "/coldWind/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1"); getTransformByPath(stri + "/coldWind/award/1/Text").GetComponent <Text>().text = dicClan[3].add_money_num.ToString(); getTransformByPath(stri + "/coldWind/award/2/Text").GetComponent <Text>().text = dicClan[3].item_num.ToString(); new BaseButton(getTransformByPath(stri + "/coldWind/award/2")).onClick = (GameObject go) => { ArrayList arr = new ArrayList(); arr.Add(dicClan[3].item_id); arr.Add(1); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr); }; #endregion #region ====button==== new BaseButton(getTransformByPath("candodart/btn_close")).onClick = (GameObject go) => { InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); }; new BaseButton(getTransformByPath("bg")).onClick = (GameObject go) => { InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); }; new BaseButton(getTransformByPath("cantdart/close")).onClick = (GameObject go) => { InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); }; new BaseButton(getTransformByPath("cantdart/bg/back")).onClick = (GameObject go) => { InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); }; new BaseButton(getTransformByPath("cantdart/bg/go")).onClick = (GameObject go) => { if ((int)PlayerModel.getInstance().mapid == 10) { //SelfRole.moveToNPc(10, 1003); } else { SelfRole.Transmit(10 * 100 + 1); } ltes = true; InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); }; new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/UndergroundCity/enter")).onClick = (GameObject go) => { if (!a3_dartproxy.getInstance().canOpenDart) { flytxt.instance.fly(ContMgr.getCont("clan_12")); return; } else { if (A3_LegionModel.getInstance().myLegion.clanc < 3) //领袖为4,元老为3 { flytxt.instance.fly(ContMgr.getCont("clan_10")); InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); } else { a3_dartproxy.getInstance().sendDartStart(dicClan[1].pathid); a3_dartproxy.getInstance().isme = true; ltes = true; //ltes要改成服务器发送 InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); } } }; new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/darkPalace/enter")).onClick = (GameObject go) => { if (!a3_dartproxy.getInstance().canOpenDart) { flytxt.instance.fly(ContMgr.getCont("clan_12")); return; } else { if (A3_LegionModel.getInstance().myLegion.clanc < 3 || A3_LegionModel.getInstance().myLegion.lvl < three)//领袖为4,元老为3 { flytxt.instance.fly(ContMgr.getCont("clan_10")); InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); } else if (A3_LegionModel.getInstance().myLegion.clanc >= 3 && A3_LegionModel.getInstance().myLegion.lvl >= three) { a3_dartproxy.getInstance().sendDartStart(dicClan[2].pathid); a3_dartproxy.getInstance().isme = true; ltes = true; InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); } } }; new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/coldWind/enter")).onClick = (GameObject go) => { if (!a3_dartproxy.getInstance().canOpenDart) { flytxt.instance.fly(ContMgr.getCont("clan_12")); return; } else { if (A3_LegionModel.getInstance().myLegion.clanc < 3 || A3_LegionModel.getInstance().myLegion.lvl < five)//领袖为4,元老为3 { flytxt.instance.fly(ContMgr.getCont("clan_10")); InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); } else if (A3_LegionModel.getInstance().myLegion.clanc >= 3 && A3_LegionModel.getInstance().myLegion.lvl >= five) { a3_dartproxy.getInstance().sendDartStart(dicClan[3].pathid); a3_dartproxy.getInstance().isme = true; ltes = true; InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART); } } }; #endregion if (a3_dartproxy.getInstance().show2) { getGameObjectByPath("candodart").SetActive(false); getGameObjectByPath("cantdart").SetActive(true); } #region ====事件监听==== A3_LegionProxy.getInstance().addEventListener(A3_LegionProxy.EVENT_CREATE, creatLegion); A3_LegionProxy.getInstance().addEventListener(A3_LegionProxy.EVENT_LVUP, upLegion); a3_dartproxy.getInstance().addEventListener(a3_dartproxy.EVENT_GETINFO, info); #endregion }
void buildBtnOnClick(int type) { A3_LegionProxy.getInstance().SendBuild((uint)(type + 1)); }
void getAwardBtnOnClick(int id) { A3_LegionProxy.getInstance().SendBuildAwd((uint)(id)); }