void RefreshNearby() { for (int i = tfNearbyContainer.childCount; i > 0; i--) { GameObject.Destroy(tfNearbyContainer.GetChild(i - 1).gameObject); } foreach (KeyValuePair <uint, ProfessionRole> item in OtherPlayerMgr._inst.m_mapOtherPlayerSee) { GameObject go = GameObject.Instantiate(prefabFriendInfo); string name = item.Value.roleName; string level = item.Value.zhuan + ContMgr.getCont("zhuan") + item.Value.lvl + ContMgr.getCont("ji"); int combat = item.Value.combpt; uint cid = item.Value.m_unCID; uint map_id = PlayerModel.getInstance().mapid; go.transform.Find("Toggle/containts/txtName").GetComponent <Text>().text = name; go.transform.Find("Toggle/containts/txtLevel").GetComponent <Text>().text = level; go.transform.Find("Toggle/containts/txtcombat").GetComponent <Text>().text = combat.ToString(); go.transform.Find("Toggle/containts/txtpos").GetComponent <Text>().text = SvrMapConfig.instance.getSingleMapConf(map_id)["map_name"]._str; go.transform.SetParent(tfNearbyContainer, false); new BaseButton(go.transform.Find("btn_invite")).onClick = (_go) => { TeamProxy.getInstance().SendInvite(cid); }; } }
//刷新按钮 void RefreshOnClick(GameObject go) { Clear_con(); //print("tabIdx:" + tabIdx + "begin_index:" + begin_index + "end_index:" + end_index); TeamProxy.getInstance().SendGetPageTeam((uint)now_Tpid, (uint)(now_tab - 1) * 10, (uint)(now_tab - 1) * 10 + 10); //switch (tabIdx) //{ // case 0: // //服务器发请求,组队目的为:自定义,所有队伍数据 // TeamProxy.getInstance().SendGetPageTeam(0, begin_index, end_index); // break; // case 1: // //服务器发请求,组队目的为:挂机,所有队伍数据 // TeamProxy.getInstance().SendGetPageTeam(1, begin_index, end_index); // break; // case 2: // //服务器发请求,组队目的为:魔物猎人,所有队伍数据 // TeamProxy.getInstance().SendGetPageTeam(2, begin_index, end_index); // break; // case 3: // //组队副本墓穴 // TeamProxy.getInstance().SendGetPageTeam(108, begin_index, end_index); // break; // case 4: // //兽灵秘境 // TeamProxy.getInstance().SendGetPageTeam(105, begin_index, end_index); // break; // default: // break; //} }
//创建/离开队伍/成为队长 private void OnTeamStatuChange(GameEvent e = null) { if (PlayerModel.getInstance().IsInATeam) { btnCreate.gameObject.SetActive(false); btnQuickJoin.gameObject.SetActive(false); if (PlayerModel.getInstance().IsCaptain) { btnStart.gameObject.SetActive(true); btnStart.interactable = true; btnInvite.gameObject.SetActive(true); btncall.gameObject.SetActive(true); if (TeamProxy.getInstance().MyTeamData != null) { toggleApply.gameObject.SetActive(true); toggleApply.isOn = TeamProxy.getInstance().MyTeamData.dirJoin; } } else { btnStart.interactable = false; btnInvite.gameObject.SetActive(false); btncall.gameObject.SetActive(false); toggleApply.gameObject.SetActive(false); } } else { btnCreate.gameObject.SetActive(true); btnQuickJoin.gameObject.SetActive(true); toggleApply.gameObject.SetActive(false); btncall.gameObject.SetActive(false); } }
private void setTeamBuffTxt() { int itmCount = TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count; if (itmCount >= 2) { //txtTeambuff.text = "同仇敌忾:攻击+" + itmCount * 6 + "%"; txtTeambuff.text = ContMgr.getCont("a3_currentTeamPanel_add", new List <string>() { (itmCount * 6).ToString() }); } else { txtTeambuff.text = ContMgr.getCont("a3_currentTeamPanel_add1"); } if (TeamProxy.getInstance().MyTeamData != null) { if (TeamProxy.getInstance().MyTeamData.meIsCaptain == false) { team_object_change.enabled = false; team_object.transform.FindChild("Arrow").gameObject.SetActive(false); } else { team_object_change.enabled = true; team_object.transform.FindChild("Arrow").gameObject.SetActive(true); } } }
public void worldteampos() { if (m_goWorldmap.activeInHierarchy && TeamProxy.getInstance().MyTeamData != null) { teamWorldPic(); } }
public void teampos() { if (m_goMapcon.activeInHierarchy && TeamProxy.getInstance().MyTeamData != null) { resfreshTeamPos(); } }
void onBtnOKClick(GameObject go) { a3_expbar.instance.showBtnTeamTips(false); // TickMgr.instance.removeTick(showTime); TeamProxy.getInstance().SendAffirmInvite(m_itd.cid, m_itd.teamId, true); InterfaceMgr.getInstance().close(InterfaceMgr.A3_TEAMINVITEDPANEL); }
void onChangeTeamInfo(GameEvent e) { if (TeamProxy.getInstance().MyTeamData.meIsCaptain) { togInvite.gameObject.SetActive(true); // togJoin.gameObject.SetActive(true); if (e.data.ContainsKey("memb_inv") && togInvite.isOn != TeamProxy.getInstance().MyTeamData.membInv) { togInvite.isOn = TeamProxy.getInstance().MyTeamData.membInv; } //if (e.data.ContainsKey("dir_join") && togJoin.isOn != TeamProxy.getInstance().MyTeamData.dirJoin) // { //togJoin.isOn = TeamProxy.getInstance().MyTeamData.dirJoin; // } } else { bool isEnable = TeamProxy.getInstance().MyTeamData.membInv; int startCount = TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count; for (int i = startCount; i < itemMemberObjList.Count; i++) { itemMemberObjList[i].ClearInfo(isEnable); } } }
void changeCaptainPos() { int memberCount = TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count; ItemTeamMemberData itmd = TeamProxy.getInstance().MyTeamData; List <ItemTeamData> itemTeamDataList = TeamProxy.getInstance().MyTeamData.itemTeamDataList; int imoCount = itemMemberObjList.Count; for (int i = 0; i < memberCount; i++) { for (int j = 0; j < itemMemberObjList.Count; j++) { if (itemTeamDataList[i].cid == itemMemberObjList[j].cid) { if (itemTeamDataList[i].isCaptain) { ItemMemberObj imo = itemMemberObjList[j]; itemMemberObjList.RemoveAt(j); itemMemberObjList.Insert(0, imo); } } } } for (int i = 0; i < itemMemberObjList.Count; i++) { itemMemberObjList[i].root.SetSiblingIndex(i); } }
void onAffirmInvite(GameEvent e) { Variant data = e.data; if (data == null) { return; } if (data.ContainsKey("cid")) { uint cid = data["cid"]; List <ItemTeamData> itdList = TeamProxy.getInstance().MyTeamData.itemTeamDataList; for (int i = 0; i < itdList.Count; i++) { if (!m_ItemCurrentTeamInfoDic.ContainsKey(cid) && cid != PlayerModel.getInstance().cid) { ItemCurrentTeamInfo icti = new ItemCurrentTeamInfo(itemCurrentInfoPrefab); m_ItemCurrentTeamInfoDic.Add(cid, icti); } } } if (TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count < 5) { getGameObjectByPath("contant/friend").SetActive(true); } else { getGameObjectByPath("contant/friend").SetActive(false); } getTransformByPath("contant/friend").SetAsLastSibling(); }
void SendSyncTeamBlood() { if (TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count > 1) { TeamProxy.getInstance().SendSyncTeamBlood(); } }
public override void onClosed() { #region remove listeners from events //TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_CREATETEAM, OnTeamStatuChange); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_CREATETEAM, OnCreateTeam); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_CHANGECAPTAIN, OnTeamStatuChange); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_KICKOUT, OnMemberInfoChange); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_NEWMEMBERJOIN, OnMemberInfoChange); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_LEAVETEAM, OnMemberInfoChange); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_CURPAGE_TEAM, OnRefreshTeamInfo); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_AFFIRMINVITE, OnTeamStatuChange); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_DISSOLVETEAM, OnTeamDissolve); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_TEAM_READY, OnReady); #endregion levelId = 0; tfOpRoot.SetParent(transform, false); tfOpRoot.gameObject.SetActive(false); if (uiData != null && uiData.Count == 1) { bufferData = uiData; } for (int i = rectContent.transform.childCount; i > 0; i--) { Destroy(rectContent.transform.GetChild(i - 1).gameObject); } Instance = null; }
private void OnFastJoin(GameEvent e) { uint tid = 0; if (e.data != null && e.data.ContainsKey("info")) { List <Variant> teamInfoList = e.data["info"]._arr; for (int i = 0; i < teamInfoList.Count; i++) { if (!teamInfoList[i].ContainsKey("dir_join") || !teamInfoList[i]["dir_join"]) { continue; } else { tid = teamInfoList[i]["tid"]; break; } } if (tid != 0) { TeamProxy.getInstance().SendApplyJoinTeam(tid); } else { TeamProxy.getInstance().SendCreateTeam((int)levelId); //flytxt.instance.fly(ContMgr.getCont("a3_fb_team_noteam")); } } TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_CURPAGE_TEAM, OnFastJoin); }
private void Set_apply(Transform go, ItemTeamData data) { uint lv = PlayerModel.getInstance().up_lvl * 100 + PlayerModel.getInstance().lvl; if (data.curcnt >= 5) { go.transform.FindChild("4/full").gameObject.SetActive(true); go.transform.FindChild("4/apply").gameObject.SetActive(false); go.transform.FindChild("4/applyed").gameObject.SetActive(false); } if (data.curcnt < 5 && go.transform.FindChild("4/applyed").gameObject.activeInHierarchy == false && lv >= limited_dj) { go.transform.FindChild("4/full").gameObject.SetActive(false); go.transform.FindChild("4/apply").gameObject.SetActive(true); go.transform.FindChild("4/applyed").gameObject.SetActive(false); new BaseButton(go.transform.FindChild("4/apply")).onClick = (GameObject oo) => { if (TeamProxy.getInstance().MyTeamData == null) { //Debug.LogError(data.teamId); TeamProxy.getInstance().SendApplyJoinTeam(data.teamId); go.transform.FindChild("4/apply").gameObject.SetActive(false); go.transform.FindChild("4/applyed").gameObject.SetActive(true); } else { flytxt.instance.fly(ContMgr.getCont("a3_teamPanel_goout")); } }; } }
public override void onShowed() { if (uiData == null) { if (current != null) { current.onShowed(); } else { tab.setSelectedIndex(0); OnSwitch(tab); } } else { int index = (int)uiData[0]; if (uiData.Count > 1) { A3_LegionModel.getInstance().showtype = (int)uiData[1]; } tab.setSelectedIndex(index); OnSwitch(tab); } if (teamList != null && (teamList == current || currentTeam == current)) { TeamProxy.getInstance().SetTeamPanelInfo(); } if (GRMap.GAME_CAMERA != null) { GRMap.GAME_CAMERA.SetActive(false); } Toclose = false; UiEventCenter.getInstance().onWinOpen(uiName); }
private bool EnemySelector(ProfessionRole p) { if (p == null) { return(true); } if (PlayerModel.getInstance().pk_state == PK_TYPE.PK_PKALL) { return(false); // 在全体攻击模式下,没有需要过滤的目标 } else if (PlayerModel.getInstance().pk_state == PK_TYPE.PK_TEAM) { if (TeamProxy.getInstance().MyTeamData == null || TeamProxy.getInstance().MyTeamData.itemTeamDataList == null) { return(false); //在团队模式下,如果没有队伍,则没有需要过滤的目标 } else if (TeamProxy.getInstance().MyTeamData.itemTeamDataList.Exists((m) => m.cid == p.m_unCID)) { if (SelfRole._inst.m_LockRole == p) // 正在攻击我的角色成为了我的队员,清除锁定 { SelfRole._inst.m_LockRole = null; } return(true); //过滤队员 } else { return(false); } } return(false); }
private void lvl_pvpinfo_board_res(Variant msgData) { NetClient.instance.dispatchEvent( GameEvent.Create(PKG_NAME.S2C_LVL_PVPINFO_BOARD_RES, this, GameTools.CreateSwitchData("lvl_pvpinfo_board_msg", msgData)) ); TeamProxy.getInstance().dispatchEvent(GameEvent.Create(PKG_NAME.S2C_LVL_PVPINFO_BOARD_RES, this, msgData)); }
public void refeshHpColor() { foreach (KeyValuePair <INameObj, PlayerNameItem> item in dItem) { if (item.Key is ProfessionRole) { item.Value.hp.gameObject.GetComponent <Image>().color = ((item.Key as BaseRole).m_unTeamID != 0 && (item.Key as BaseRole).m_unTeamID == PlayerModel.getInstance().teamid) ? new Color(128f / 255f, 223f / 255f, 120f / 255f, 255f / 255f) : new Color(229f / 255f, 49f / 255f, 49f / 255f, 255f / 255f); } else if (item.Key is MS0000) { var v = item.Key as MS0000; var a = TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().MyTeamData.IsInMyTeam((item.Key as MS0000).masterid); if ((TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().MyTeamData.IsInMyTeam((item.Key as MS0000).masterid)) || (item.Key as MS0000).masterid == PlayerModel.getInstance().cid) { item.Value.hp.gameObject.GetComponent <Image>().color = new Color(128f / 255f, 223f / 255f, 120f / 255f, 255f / 255f); } else { item.Value.hp.gameObject.GetComponent <Image>().color = new Color(229f / 255f, 49f / 255f, 49f / 255f, 255f / 255f); } } } }
void onNewMemberJoin(GameEvent e) { Variant data = e.data; uint cid = data["cid"]; string name = data["name"]; uint carr = data["carr"]; if (!m_ItemCurrentTeamInfoDic.ContainsKey(cid)) { ItemCurrentTeamInfo icti = new ItemCurrentTeamInfo(itemCurrentInfoPrefab); icti.SetTxtName(name); icti.sethead(carr); m_ItemCurrentTeamInfoDic.Add(cid, icti); } else { m_ItemCurrentTeamInfoDic[cid].sethead(carr); m_ItemCurrentTeamInfoDic[cid].SetTxtName(name); } if (TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count < 5) { getGameObjectByPath("contant/friend").SetActive(true); } else { getGameObjectByPath("contant/friend").SetActive(false); } getTransformByPath("contant/friend").SetAsLastSibling(); }
void onLeaveTeam(GameEvent e) { //初始化数据 _instance.gameObject.SetActive(false); a3_teamPanel._instance.gameObject.SetActive(true); TeamProxy.getInstance().SendGetMapTeam(a3_teamPanel._instance.begin_index, a3_teamPanel._instance.end_index); }
public override void onClose() { base.onClose(); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_CREATETEAM, onCreateTeam); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_DISSOLVETEAM, onDissolveTeam); TeamProxy.getInstance().removeEventListener(TeamProxy.EVENT_TEAMLISTINFO, onGetTeamListInfo); }
private void OnClickOpKick(GameObject go) { if (curSelectedCid != 0 && TeamProxy.getInstance().MyTeamData.IsInMyTeam(curSelectedCid)) { TeamProxy.getInstance().SendKickOut(curSelectedCid); TeamProxy.getInstance().SendGetPageTeam(levelId, TeamProxy.BEGININDEX, TeamProxy.ENDINDEX); } }
private void OnBackRespawn(GameObject go) { MapProxy.getInstance().sendRespawn(false); //PlayerModel.getInstance().c if (MapModel.getInstance().curLevelId == 108 || MapModel.getInstance().curLevelId == 109 || MapModel.getInstance().curLevelId == 110 || MapModel.getInstance().curLevelId == 111) { TeamProxy.getInstance().SendLeaveTeam(PlayerModel.getInstance().cid); } }
public override void onShowed() { base.onShowed(); TeamProxy.getInstance().SendGetMapTeam(begin_index, end_index); TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CREATETEAM, onCreateTeam); TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_DISSOLVETEAM, onDissolveTeam); TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_TEAMLISTINFO, onGetTeamListInfo); }
void onNoticeHaveMemberLeave(GameEvent e) { Variant data = e.data; uint cid = data["cid"]; //不用删除后边的,直接用set,然后将信息擦除,放到last int indexRemove = (int)TeamProxy.getInstance().MyTeamData.removedIndex; ItemMemberObj imo = itemMemberObjList[indexRemove]; itemMemberObjList.RemoveAt(indexRemove); itemMemberObjList.Add(imo); imo.ClearInfo(); for (int i = indexRemove; i < itemMemberObjList.Count; i++) { itemMemberObjList[i].root.SetSiblingIndex(i); } int itemMemberCount = TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count; for (int i = indexRemove; i < itemMemberCount; i++) { ItemTeamData itd = TeamProxy.getInstance().MyTeamData.itemTeamDataList[i]; itemMemberObjList[i].SetInfo(itd, TeamProxy.getInstance().MyTeamData.meIsCaptain); } for (int i = itemMemberCount; i < itemMemberObjList.Count; i++)//对空位置的操作 { if (TeamProxy.getInstance().MyTeamData.meIsCaptain || TeamProxy.getInstance().MyTeamData.membInv) { itemMemberObjList[i].ClearInfo(true); } else { itemMemberObjList[i].ClearInfo(); } } if (TeamProxy.getInstance().MyTeamData.meIsCaptain) { togInvite.gameObject.SetActive(true); // togJoin.gameObject.SetActive(true); if (togInvite.isOn != TeamProxy.getInstance().MyTeamData.membInv) { togInvite.isOn = TeamProxy.getInstance().MyTeamData.membInv; } // if (togJoin.isOn != TeamProxy.getInstance().MyTeamData.dirJoin) //{ // togJoin.isOn = TeamProxy.getInstance().MyTeamData.dirJoin; // } } else { togInvite.gameObject.SetActive(false); // togJoin.gameObject.SetActive(false); } setTeamBuffTxt(); ItemTeamMemberData itm = TeamProxy.getInstance().MyTeamData; Show(itm); }
public TeamInfoObject(uint teamId, GameObject main, Transform goBtn) { tid = teamId; goMain = main; goBtnJoin = goBtn; goBtn.transform.parent.gameObject.SetActive(!PlayerModel.getInstance().IsInATeam); new BaseButton(goBtnJoin).onClick = (go) => { TeamProxy.getInstance().SendApplyJoinTeam(tid); main.transform.Find("btn_join/applyed").gameObject.SetActive(true); }; }
private void OnClickMsg(GameObject go) { if (!PlayerModel.getInstance().IsCaptain) { flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_not_captain")); return; } if (PlayerModel.getInstance().inFb) { flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_in_fb")); return; } a3_chatroom._instance.SendMsg(string.Format("{0}:{1}:{2}", TeamProxy.getInstance().MyTeamData.teamId, curTeamType, TeamProxy.getInstance().mapItemTeamData == null?0: TeamProxy.getInstance().mapItemTeamData.ldiff), chatType: ChatToType.World, xtp: 1); }
void onBtnJoinTeamClick(GameObject go) { foreach (KeyValuePair <uint, itemTeamInfoPrefab> itip in itemTeamInfoPrefabDic) { bool isON = itip.Value.root.GetComponent <Toggle>().isOn; if (isON) { TeamProxy.getInstance().SendApplyJoinTeam(itip.Key); break; } } }
private void on_monster_enter_zone(Variant msgData) { debug.Log("++++++++++++++++++++++++++monster+" + msgData.dump()); foreach (Variant m in msgData["monsters"]._arr) { if (m.ContainsKey("carr")) { //OtherPlayerMgr._inst.AddOtherPlayer(m); MonsterMgr._inst.AddMonster_PVP(m); } else if (m.ContainsKey("owner_cid")) { MonsterMgr._inst.AddSummon(m); } else { MonsterRole role; if (m.ContainsKey("owner_name")) { string ownerName = m["owner_name"]; if (TeamProxy.getInstance().MyTeamData == null && !PlayerModel.getInstance().name.Equals(ownerName)) { } //role = MonsterMgr._inst.AddMonster(m, invisible: false); else if (TeamProxy.getInstance().MyTeamData != null && !TeamProxy.getInstance().MyTeamData.IsInMyTeam(ownerName)) { } //role = MonsterMgr._inst.AddMonster(m, invisible: false); else { role = MonsterMgr._inst.AddMonster(m /*, ownerName == PlayerModel.getInstance().name*/); } } else { role = MonsterMgr._inst.AddMonster(m); } } if (m.ContainsKey("escort_name")) { if (PlayerModel.getInstance().up_lvl >= 1) { MonsterMgr._inst.AddDartCar(m); } else { MonsterMgr._inst.RemoveMonster(m["iid"]); } } } }
void addTeam() { uint cid = SelfRole._inst.m_LockRole.m_unCID; TeamProxy.getInstance().SendTEAM(cid); //if(TeamProxy.getInstance().MyTeamData==null&&) //TeamProxy.getInstance().SendInvite(cid); TeamProxy.getInstance().trage_cid = cid; hide(); //return; }