// 游戏退出时使用 public void Release() { if (m_IControllerHelper != null) { m_IControllerHelper = null; } if (m_switchTargt != null) { m_switchTargt.Relese(); m_switchTargt = null; } if (m_ActiveCtrl != null) { m_ActiveCtrl = null; } //if (m_MissionRobot != null) //{ // m_MissionRobot = null; //} if (m_CombatRobot != null) { m_CombatRobot.Stop(); m_CombatRobot = null; } }
//private MissionRobot m_MissionRobot = null; public ControllerSystem(IClientGlobal clientGlobal) { m_ClientGlobal = clientGlobal; m_ActiveCtrl = new Controller(m_ClientGlobal); m_CombatRobot = new CombatRobot(); m_switchTargt = new SwitchTarget(); //m_MissionRobot = new MissionRobot(); }
CombatRobotStatus GetRobotState() { Client.IControllerSystem cs = Client.ClientGlobal.Instance().GetControllerSystem(); if (cs != null) { ICombatRobot cr = cs.GetCombatRobot(); if (cr != null) { return(cr.Status); } } return(CombatRobotStatus.STOP); }
public void OnUseSkill(uint uSkillID) { if (uSkillID == 0) { return; } IControllerSystem cs = ClientGlobal.Instance().GetControllerSystem(); if (cs == null) { Engine.Utility.Log.Error("ExecuteCmd: ControllerSystem is null"); return; } ICombatRobot combot = cs.GetCombatRobot(); if (combot.Status == CombatRobotStatus.RUNNING) { //解除普攻连击 stSkillLongPress longPress = new stSkillLongPress(); longPress.bLongPress = false; EventEngine.Instance().DispatchEvent((int)GameEventID.SKLL_LONGPRESS, longPress); combot.InsertSkill(uSkillID); return; } bool canuse = EventEngine.Instance().DispatchVote((int)GameVoteEventID.SKILL_CANUSE, uSkillID); if (canuse) { table.SkillDatabase db = GameTableManager.Instance.GetTableItem <table.SkillDatabase>(uSkillID, 1); if (db != null) { IControllerSystem ctrl = ClientGlobal.Instance().GetControllerSystem(); if (ctrl != null) { MessageCode code = MessageCode.MessageCode_ButtonX; ctrl.OnMessage(code, uSkillID); } } } else { IPlayer mainPlayer = MainPlayerHelper.GetMainPlayer(); if (mainPlayer != null) { ISkillPart skillPart = mainPlayer.GetPart(EntityPart.Skill) as ISkillPart; if (skillPart != null) { Client.stTipsEvent en = skillPart.GetSkillNotUseReason(uSkillID); if (en.errorID != 0) { EventEngine.Instance().DispatchEvent((int)GameEventID.TIPS_EVENT, en); } } } AddSkillCommond(uSkillID); } }