void PlayAni(uint uid, string entityAction) { Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem(); if (es == null) { return; } Client.IPlayer player = es.FindPlayer(uid); if (player == null) { return; } //处理 PlayAni anim_param = new PlayAni(); anim_param.strAcionName = entityAction; anim_param.fSpeed = 1; anim_param.nStartFrame = 0; anim_param.nLoop = -1; anim_param.fBlendTime = 0.2f; player.SendMessage(EntityMessage.EntityCommand_PlayAni, anim_param); }
// 进入场景 public void Enter() { HomeSceneID = GameTableManager.Instance.GetGlobalConfig <uint>("HomeSceneID"); IMapSystem mapSys = ClientGlobal.Instance().GetMapSystem(); if (mapSys == null) { return; } mapSys.EnterMap(HomeSceneID, Vector3.zero); IControllerSystem cs = ClientGlobal.Instance().GetControllerSystem(); if (cs == null) { return; } Client.IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer; if (mainPlayer != null) { mainPlayer.SendMessage(EntityMessage.EntityCommand_SetVisible, false); } cs.GetActiveCtrl().SetClickSink(this); m_AnimalManager.Init(); }
void StopMove() { //移动摇杆打断自动寻路,角色会滑步 Client.IPlayer player = Client.ClientGlobal.Instance().MainPlayer; if (player == null) { return; } bool moving = (bool)player.SendMessage(Client.EntityMessage.EntityCommand_IsMove, null); if (moving) { player.SendMessage(Client.EntityMessage.EntityCommand_StopMove, player.GetPos()); } Engine.Utility.EventEngine.Instance().DispatchEvent((int)(int)Client.GameEventID.JOYSTICK_PRESS, null); }
void MainPlayStop() { Client.IPlayer player = Client.ClientGlobal.Instance().MainPlayer; if (player != null) { player.SendMessage(Client.EntityMessage.EntityCommand_StopMove, player.GetPos()); Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.ROBOTCOMBAT_SEARCHPATH, false); //关闭自动寻路中 } Controller.CmdManager.Instance().Clear(); //清除寻路 }
public bool TryRide(Action <object> callback, object param) { Client.IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer; if (mainPlayer != null) { bool bRide = (bool)mainPlayer.SendMessage(Client.EntityMessage.EntityCommond_IsRide, null); if (!bRide) { return(DataManager.Manager <RideManager>().TryUsingRide(callback, param)); } } return(false); }
void onClick_Deliver_queidng_Btn(GameObject caster) { string[] name = caster.name.Split("_".ToCharArray()); GameObject target = m_widget_MissionContent.transform.Find(name[0]).gameObject; UIInput[] input = target.transform.GetComponentsInChildren <UIInput>(); List <uint> paramings = new List <uint>(); foreach (var inp in input) { UILabel l = inp.GetComponentInChildren <UILabel>(); UILabel parent = inp.GetComponentInParent <UILabel>(); if (this.isNumber(l.text)) { uint number = uint.Parse(l.text); paramings.Add(number); } else { Engine.Utility.Log.Error("{0}数值输入不规范!", parent.name); } } Client.IPlayer player = Client.ClientGlobal.Instance().MainPlayer; if (player == null) { return; } bool moving = (bool)player.SendMessage(Client.EntityMessage.EntityCommand_IsMove, null); if (moving) { player.SendMessage(Client.EntityMessage.EntityCommand_StopMove, player.GetPos()); } string msg = string.Format("//goto map={0} pos={1},{2}", paramings[0], paramings[1], paramings[2]); DataManager.Manager <ChatDataManager>().SendChatText(msg); Debug.Log(msg); }
// 离开场景 public void Leave() { IControllerSystem cs = ClientGlobal.Instance().GetControllerSystem(); if (cs == null) { return; } Client.IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer; if (mainPlayer != null) { mainPlayer.SendMessage(EntityMessage.EntityCommand_SetVisible, false); cs.GetActiveCtrl().SetHost(mainPlayer); mainPlayer.SendMessage(EntityMessage.EntityCommand_SetVisible, true); } cs.GetActiveCtrl().SetClickSink(null); m_AnimalManager.Clear(); HomeSceneUIRoot.Instance.ReleaseUI(); Clear(); }
private static uint s_uSceneid = 15; // 战斗场景id public void Enter() { IMapSystem mapSys = ClientGlobal.Instance().GetMapSystem(); if (mapSys == null) { return; } mapSys.EnterMap(s_uSceneid, Vector3.zero); IControllerSystem cs = ClientGlobal.Instance().GetControllerSystem(); if (cs == null) { return; } Client.IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer; if (mainPlayer != null) { mainPlayer.SendMessage(EntityMessage.EntityCommand_SetVisible, false); } }
void OnMainBtnClick(int index) { MainBtnDef.BtnType btnType = (MainBtnDef.BtnType)index; switch (btnType) { case MainBtnDef.BtnType.BTNBAG: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.KnapsackPanel, forceResetPanel: true); } break; case MainBtnDef.BtnType.BTNFROGING: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ForgingPanel); } break; case MainBtnDef.BtnType.BTNFRIEND: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.FriendPanel); } break; case MainBtnDef.BtnType.BTNGEM: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ComposePanel); } break; case MainBtnDef.BtnType.BTNBTNHORSE: { if (DataManager.Manager <RideManager>().Auto_Ride <= 0) { TipsManager.Instance.ShowTips(LocalTextType.Ride_Commond_haiweishezhichuzhanzuoqiwufaqicheng); return; } Client.IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer; if (mainPlayer != null) { bool bChange = (bool)mainPlayer.SendMessage(Client.EntityMessage.EntityCommand_IsChange, null); if (bChange) { TipsManager.Instance.ShowTips(LocalTextType.Ride_Commond_bianshenzhuangtaixiawufaqicheng); return; } bool bRide = DataManager.Manager <RideManager>().IsRide; if (mainPlayer != null) { if (bRide) { DataManager.Instance.Sender.RideDownRide(null); } else { DataManager.Manager <RideManager>().TryUsingRide(null, null); } } } } break; case MainBtnDef.BtnType.BTNRIDE: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.RidePanel); } break; case MainBtnDef.BtnType.BTNPET: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PetPanel); } break; case MainBtnDef.BtnType.BTNLEARNSKILL: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.LearnSkillPanel); } break; case MainBtnDef.BtnType.BTNMUHON: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.MuhonPanel); } break; case MainBtnDef.BtnType.BTNSETTING: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.SettingPanel); } break; case MainBtnDef.BtnType.BTNGM: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.GMPanel); } break; case MainBtnDef.BtnType.BTNXIAZAI: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DownloadPanel); } break; case MainBtnDef.BtnType.BTNHOME: { int level = GameTableManager.Instance.GetGlobalConfig <int>("HomeBaseOpenLv"); IPlayer mp = ClientGlobal.Instance().MainPlayer; if (mp != null) { int playerLevel = mp.GetProp((int)CreatureProp.Level); if (playerLevel < level) { TipsManager.Instance.ShowTips("家园需要" + level + "级开放"); return; } else { HomeScene.Instance.Enter(); } } } break; case MainBtnDef.BtnType.BTNPROP: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PropPanel); } break; case MainBtnDef.BtnType.BTNARENA: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ArenaPanel); } break; case MainBtnDef.BtnType.BTNSTORE: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.MallPanel); } break; case MainBtnDef.BtnType.BTNBLACKMARKET: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.BlackMarketPanel); } break; case MainBtnDef.BtnType.BTNCLAN: { if (!DataManager.Manager <ClanManger>().IsClanEnable) { TipsManager.Instance.ShowTips(string.Format("{0}级开放", ClanManger.ClanUnlockLevel)); } else { if (DataManager.Manager <ClanManger>().IsJoinClan && DataManager.Manager <ClanManger>().IsJoinFormal) { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ClanPanel); } else { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ClanCreatePanel); } } } break; case MainBtnDef.BtnType.BTNRANKLIST: { int level = GameTableManager.Instance.GetGlobalConfig <int>("Rank_OpenLevel"); IPlayer mp = ClientGlobal.Instance().MainPlayer; if (mp != null) { int playerLevel = mp.GetProp((int)CreatureProp.Level); if (playerLevel < level) { TipsManager.Instance.ShowTips(string.Format("{0}级开启排行榜功能", level)); return; } } DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.RankPanel); } break; case MainBtnDef.BtnType.BTNFUBEN: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.FBPanel); } break; case MainBtnDef.BtnType.BTNPETROLE: { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PetPanel); } break; case MainBtnDef.BtnType.BTNAUCTION: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ConsignmentPanel); break; case MainBtnDef.BtnType.BTNDAILY: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DailyPanel); break; case MainBtnDef.BtnType.BTNWELFARE: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.WelfarePanel); break; case MainBtnDef.BtnType.BTNSEVENDAY: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.SevenDayPanel); break; // case MainBtnDef.BtnType.BTNHUNTING: // DataManager.Manager<UIPanelManager>().ShowPanel(PanelID.HuntingPanel); // break; case MainBtnDef.BtnType.BTNACHIEVEMENT: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.AchievementPanel); break; case MainBtnDef.BtnType.BTNACTIVITY: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ActivityPanel); break; case MainBtnDef.BtnType.BTNGROWUP: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.GrowUpPanel); break; case MainBtnDef.BtnType.BTNQUESTION: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.QuestionPanel); break; case MainBtnDef.BtnType.BTNGODWEAPEN: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.GodWeapenPanel); break; case MainBtnDef.BtnType.BTNOPENSERVER: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.OpenServerPanel); break; case MainBtnDef.BtnType.BTNFIRSTRECHARGE: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.FirstRechargePanel); ControlMainBtnParticle(m_sprite_FirstRecharge_warning.parent.transform, false); break; case MainBtnDef.BtnType.BTNFANLI: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ActivityRewardListPanel); break; case MainBtnDef.BtnType.BTNACCUMULATIVERECHARGE: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.AccumulativeRechargePanel); break; case MainBtnDef.BtnType.BTNNOBLE: ItemManager.DoJump(112); //黄令 break; case MainBtnDef.BtnType.None: break; default: break; } }
/// <summary> /// 请求读条上马 /// </summary> public bool TryUsingRide(Action <object> callback, object param) { Client.IMapSystem ms = Client.ClientGlobal.Instance().GetMapSystem(); if (ms == null) { return(false); } table.MapDataBase mapdata = GameTableManager.Instance.GetTableItem <table.MapDataBase>(ms.GetMapID()); if (mapdata == null) { return(false); } if (mapdata.canUsingRide != 1) { TipsManager.Instance.ShowTips("该地图不能上马"); if (callback != null) { callback(param); } return(false); } Client.IPlayer mainPlayer = Client.ClientGlobal.Instance().MainPlayer; if (mainPlayer != null) { Client.ISkillPart skillpart = mainPlayer.GetPart(Client.EntityPart.Skill) as Client.ISkillPart; if (skillpart != null) { if (skillpart.GetCurSkillState() != (int)Client.SkillState.None) { TipsManager.Instance.ShowTips(LocalTextType.Ride_Commond_shifangjinengzhongwufashangma); if (callback != null) { callback(param); } return(false); } } bool isChangeBody = (bool)mainPlayer.SendMessage(Client.EntityMessage.EntityCommand_IsChange, null); if (isChangeBody) { if (callback != null) { callback(param); } return(false); } bool bRide = DataManager.Manager <RideManager>().IsRide; if (bRide) { if (callback != null) { callback(param); } return(false); } else if (Auto_Ride == 0) { if (callback != null) { callback(param); } return(false); } } UsingRideCallback = callback; UsingRideCallbackParam = param; if (Auto_Ride != 0) { //先发送读条 读条 结束在上马 Client.stUninterruptMagic stparam = new Client.stUninterruptMagic(); if (GetRideDataById(Auto_Ride) != null) { stparam.time = GetRideDataById(Auto_Ride).spellTime; } stparam.type = GameCmd.UninterruptActionType.UninterruptActionType_DEMON; stparam.uid = MainPlayerHelper.GetPlayerUID(); Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.SKILLGUIDE_PROGRESSSTART, stparam); //NetService.Instance.Send(new stUsingRideUserCmd_C()); } return(true); }