示例#1
0
        /// <summary>
        /// 怪物统一使用 Rigidbody 控制
        /// 子弹型刚体
        /// </summary>
        private void SendMoveCmd()
        {
            if (!curInfo.HasX)
            {
                return;
            }
            var dir       = (int)transform.localRotation.eulerAngles.y;
            var meAttr    = gameObject.GetComponent <NpcAttribute>();
            var serverPos = NetworkUtil.FloatPos(curInfo.X, curInfo.Y, curInfo.Z);
            var cmd       = new MoveCMD();

            cmd.targetPos = serverPos;
            cmd.dir       = curInfo.Dir;
            //cmd.speed = Util.NetToGameNum(curInfo.Speed);
            GetComponent <LogicCommand>().PushCommand(cmd);
        }
示例#2
0
 /// <summary>
 /// 移动命令执行的时间长度
 /// 服务器发送当前位置 以一定速度 向某个方向移动 的命令
 /// </summary>
 /// <param name="cmd"></param>
 private void RunMoveCmd(MoveCMD cmd)
 {
     cmd.CalRunTime(transform.position, attribute);
     mvController.MoveTo(cmd);
     aiBase.GetAI().OnCommand(cmd);
 }