Esempio n. 1
0
 public void OnContrllerEvent(int nEventID, object param)
 {
     if (m_Host == null)
     {
         Engine.Utility.Log.Error("MoveController.OnContrllerEvent: host is null");
         return;
     }
     if (nEventID == (int)Client.GameEventID.ENTITYSYSTEM_ENTITYSTOPMOVE)
     {
         Client.stEntityStopMove stopEntity = (Client.stEntityStopMove)param;
         if (m_bJoystick && stopEntity.uid == m_Host.GetUID() && !stopEntity.bExternal) // 自行移动停止才需要继续向前预测
         {
             // 继续向前预测
             MoveByDir(m_fCalcRotate);
         }
     }
     else if (nEventID == (int)Client.GameEventID.SKLL_LONGPRESS)
     {
         stSkillLongPress st = (stSkillLongPress)param;
         m_bSkillLongPress = st.bLongPress;
     }
     else if (nEventID == (int)Client.GameEventID.ENTITYSYSTEM_ENTITYDEAD)
     {
         stEntityDead ed = (stEntityDead)param;
         if (m_ClientGlobal.IsMainPlayer(ed.uid))
         {
             m_bJoystick = false;
             m_Host.SendMessage(EntityMessage.EntityCommand_StopMove, m_ClientGlobal.MainPlayer.GetPos());
         }
     }
     else if (nEventID == (int)Client.GameEventID.SKILL_FORBIDDENJOYSTICK)
     {
         Client.stForbiddenJoystick info   = (Client.stForbiddenJoystick)param;
         Client.IPlayer             player = m_ClientGlobal.MainPlayer;
         if (player == null)
         {
             return;
         }
         if (info.playerID == player.GetUID())
         {
             //bForbiddenJoystick = info.bFobidden;
             //if(bForbiddenJoystick)
             //{
             //   // Log.LogGroup( "ZDY" , "摇杆禁用" );
             //}
             //else
             //{
             //  //  Log.LogGroup( "ZDY" , "摇杆回复" );
             //}
         }
     }
 }
Esempio n. 2
0
 private void AddAttackCmd(IEntity target, uint skillid)
 {
     Client.IPlayer player = ControllerSystem.m_ClientGlobal.MainPlayer;
     if (target != null && skillid != 0)
     {
         if (m_CombatRobotMono != null)
         {
             m_CombatRobotMono.AddLog(string.Format("添加攻击命令 技能id:{0} {1}", skillid, UnityEngine.Time.realtimeSinceStartup));
         }
         CmdManager.Instance().AddCmd(Cmd.Attack, player.GetUID(), target.GetUID(), skillid);
     }
     else
     {
         ChangeRoleAction(RoleAction.NONE);
     }
 }
Esempio n. 3
0
    private void OnTitleWear(uint uid)
    {
        Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();

        if (es == null)
        {
            return;
        }

        Client.IPlayer entity = es.FindPlayer(uid);
        if (entity != null)
        {
            RoleStateBar bar = GetRoleBarByUID(entity.GetUID());
            if (bar != null)
            {
                bar.UpdateWidget(new HeadTipData(entity, HeadTipType.Title, m_bPlayerTitleVisible));
            }
        }
    }