void OnClickchangeH(ButtonScript obj, object args, int param1, int param2) { MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("duizhangtishi"), () => { if (TeamSystem.AwayTeam(uId)) { PopText.Instance.Show(LanguageManager.instance.GetValue("zanliduizhan")); return; } NetConnection.Instance.changeTeamLeader((uint)uId); gameObject.SetActive(false); }); }
private void OnClickguajiBtn(ButtonScript obj, object args, int param1, int param2) { if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader() && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { PopText.Instance.Show(LanguageManager.instance.GetValue("onlyLeader")); return; } NetConnection.Instance.autoBattle(); Prebattle.Instance.ChangeWalkEff(Prebattle.WalkState.WS_Normal); guajiBtn.gameObject.SetActive(false); CloseguajiBtn.gameObject.SetActive(true); }
public bool ParseNavMeshInfo(string info, NpcType type = NpcType.NT_None) { if (StageMgr.Loading) { return(false); } if (TeamSystem.IsTeamLeader() || !TeamSystem.IsInTeam() || TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { if (type != NpcType.NT_None) { NetConnection.Instance.moveToNpc2(type); return(true); } if (string.IsNullOrEmpty(info)) { return(false); } // "|" 为scene和zone分隔符 // ";" 为scene和npc分隔符 string[] parse; int sceneId; if (info.Contains("|")) { parse = info.Split('|'); sceneId = int.Parse(parse[0]); int zoneId = int.Parse(parse[1]); NetConnection.Instance.moveToZone(sceneId, zoneId); } else { parse = info.Split(';'); sceneId = int.Parse(parse[0]); int npcId = int.Parse(parse[1]); NpcData npcd = NpcData.GetData(npcId); if (npcd.Type == NpcType.NT_Caiji1 || npcd.Type == NpcType.NT_Caiji2 || npcd.Type == NpcType.NT_Caiji3) { NetConnection.Instance.moveToNpc2(npcd.Type); } else { NetConnection.Instance.moveToNpc(npcId); } //Prebattle.Instance.selectedNpc_ = npcId; } return(true); } return(false); }
// public bool transforScene(int sceneId) // { // if(GamePlayer.Instance.isInBattle == false) // { //// if(CopyData.IsCopyScene(GameManager.SceneID)) //// { //// MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("likaifuben"),()=>{ //// NetConnection.Instance.exitCopy(); //// base.transforScene(sceneId); //// }); //// }else //// { // base.transforScene(sceneId); //// } // } // return true; // } public bool move(float x, float z) { if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader() && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { return(true); } Avatar player = Prebattle.Instance.GetSelf(); if (player != null) { player.PlayerStoped_ = false; } base.move(x, z); return(true); }
bool IsleaveTeam() { if (!TeamSystem.IsInTeam()) { return(false); } for (int i = 0; i < TeamSystem.GetTeamMembers().Length; i++) { if (TeamSystem.AwayTeam((int)TeamSystem.GetTeamMembers()[i].instId_)) { return(true); } } return(false); }
public bool moveToZone(int sceneId, int zoneId) { if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader() && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { return(true); } Avatar player = Prebattle.Instance.GetSelf(); if (player != null) { player.PlayerStoped_ = false; } Prebattle.Instance.ChangeWalkEff(Prebattle.WalkState.WS_AFP); base.moveToZone(sceneId, zoneId); return(true); }
void OnClickBackCity(ButtonScript obj, object args, int param1, int param2) { if (TeamSystem.IsInTeam() && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("tishiDuiwu"), () => { // NetConnection.Instance.exitLobby (); // ReturnMainScene(); // ExitSceneOk(); TeamSystem.BackCity(); }); } else { ReturnMainScene(); //TeamUIPanel.Instance.ExitSceneOk(); } }
public void OnJoin(GameObject go) { SceneData ssdata = SceneData.GetData(GameManager.SceneID); if (ssdata.sceneType_ == SceneType.SCT_GuildBattleScene) { MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("querenlikai"), () => { if (daData_.activityKind_ == ActivityType.ACT_Family_0 || daData_.activityKind_ == ActivityType.ACT_Family_1 || daData_.activityKind_ == ActivityType.ACT_Family_2 || daData_.activityKind_ == ActivityType.ACT_Family_3 || daData_.activityKind_ == ActivityType.ACT_Family_4) { if (!GuildSystem.IsInGuild()) { PopText.Instance.Show(LanguageManager.instance.GetValue("guildCanJoin"), PopText.WarningType.WT_Warning); return; } } if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader(GamePlayer.Instance.InstId) && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { PopText.Instance.Show(LanguageManager.instance.GetValue("onlyLeaderCanOperate"), PopText.WarningType.WT_Tip); return; } string joinInfo = (string)UIEventListener.Get(go).parameter; GameManager.Instance.ParseNavMeshInfo(joinInfo, ConvertNpcType(activityType_)); HongDongPanel.HidePanelByName(UIASSETS_ID.UIASSETS_DailyActivityPanel); }, false, null, null, "", "", 2000, true); return; } if (daData_.activityKind_ == ActivityType.ACT_Family_0 || daData_.activityKind_ == ActivityType.ACT_Family_1 || daData_.activityKind_ == ActivityType.ACT_Family_2 || daData_.activityKind_ == ActivityType.ACT_Family_3 || daData_.activityKind_ == ActivityType.ACT_Family_4) { if (!GuildSystem.IsInGuild()) { PopText.Instance.Show(LanguageManager.instance.GetValue("guildCanJoin"), PopText.WarningType.WT_Warning); return; } } if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader(GamePlayer.Instance.InstId) && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { PopText.Instance.Show(LanguageManager.instance.GetValue("onlyLeaderCanOperate"), PopText.WarningType.WT_Tip); return; } string joinInfos = (string)UIEventListener.Get(go).parameter; GameManager.Instance.ParseNavMeshInfo(joinInfos, ConvertNpcType(activityType_)); HongDongPanel.HidePanelByName(UIASSETS_ID.UIASSETS_DailyActivityPanel); //if(string.IsNullOrEmpty(joinInfo)) //{ //NPCInfo npc = GameManager.Instance.GetGuaiWuGongChengNpc(); //if (npc == null) //{ // ClientLog.Instance.LogError("没有找到怪物攻城NPC"); //} //else // joinInfo = string.Format("{0},{1};{2}", npc.sceneId_, npc.areaNum_, npc.id_); // return; //} //string[] infos = joinInfo.Split(';'); //string[] sceneInfo = infos[0].Split(','); //int sceneId = int.Parse(sceneInfo[0]); //int sceneAreaNum = 0; //bool tryGetAreaNumByNpc = false; //if (sceneInfo.Length > 1) // sceneAreaNum = int.Parse(sceneInfo[1]); //else // tryGetAreaNumByNpc = true; //int npcId = 0; //Vector2 destPos = Vector2.zero; //if (infos.Length > 1) //{ // if (infos[1].Contains(",")) // { // string[] pos = infos[1].Split(','); // destPos = new Vector2(float.Parse(pos[0]), float.Parse(pos[1])); // } // else // { // npcId = int.Parse(infos[1]); // } //} //else //{ // string xml = SceneSimpleData.GetData(sceneId).sceneXml_; // int bornId = SceneData.GetBornPosEntryID(xml); // destPos = SceneData.GetEntryPos(xml, bornId); //} //bool APEOn = false; //if (npcId != 0) //{ // if (tryGetAreaNumByNpc) // { // //NPCInfo destNpc = GameManager.Instance.GetNpc(sceneId, npcId); // //if (destNpc == null) // //{ // // // npc has not refresh finished. // // tryGetAreaNumByNpc = false; // // return; // //} // //else // //{ // // sceneAreaNum = destNpc.areaNum_; // //} // //tryGetAreaNumByNpc = false; // } // APEOn = Traveller.Instance.Launch().TravelTo(sceneId, sceneAreaNum, npcId); //} //else if (destPos != Vector2.zero) // APEOn = Traveller.Instance.Launch().TravelTo(sceneId, sceneAreaNum, new Vector3(destPos.x, 0f, destPos.y)); //if (APEOn) //{ // GamePlayer.Instance.IsNotAutoPathing = true; // Prebattle.Instance.UpdateAutoPathingAction(); // Prebattle.Instance.ExcuteOnePathAction(); // Prebattle.Instance.SwitchAFPEffect(true); //} }
public void OnSelJoin(GameObject go) { if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader(GamePlayer.Instance.InstId) && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { PopText.Instance.Show(LanguageManager.instance.GetValue("onlyLeaderCanOperate"), PopText.WarningType.WT_Tip); return; } string joinInfoo = (string)UIEventListener.Get(go).parameter; GameManager.Instance.ParseNavMeshInfo(joinInfoo, ConvertNpcType(activityType_)); HongDongPanel.HidePanelByName(UIASSETS_ID.UIASSETS_DailyActivityPanel); }