NavMeshAgent 寻路导航组件

1 NavMesh 地面的烘焙方法

1.选中要导航的模型 或者 地面

2.在U3D右边Inspector面板右上角Static旁边的倒三角 ,选中 Navigation static 勾, 表示地面导航层 ,把当前选中物体设置为导航层

3.菜单栏Window ->Navigation ,Inspector面板 右下角 Bake烘焙,生成导航路径数据

4.然后要移动的角色身上添加 NavMeshAgent组件,就可以导航移动角色

1 NavMeshAgent 组件面板属性

Base offset                与地面偏移高度
speed                        移动速度
Angular Speed             转角速度 ,转身速度    角速度: 最高转速(度/秒)。
Acceleration                 加速度,启动时的 最大加速度。
Stopping Distance         停止距离 ,,制动距离:制动距离。到目的地的距离小于这个值,代理减速。
Auto Traverse OffMesh Link 自动遍历OffMesh链接:自动移动并关闭OffMeshLinks
Auto Repath                 自动重新寻路:如果现有的部分已失效,获得新的路径。
Height                         高度:代理的高度(用于调试图形)。
Base offset                   基本偏移:碰撞几何体相对于实际几何体垂直的偏移。
Obstacle Avoidance Type 障碍躲避类型 :躲避的质量水平。
NavMesh Walkable          导航网格行走:指定代理可以遍历的导航网格层类型。这个参数很有用,在接下来的实例中可以用到。

1 所有NavMeshAgent 函数和变量翻译

NavMeshAgent.acceleration 加速度
NavMeshAgent.ActivateCurrentOffMeshLink 激活当前分离网格链接
NavMeshAgent.angularSpeed 角速度
NavMeshAgent.areaMask 区域遮挡
NavMeshAgent.autoBraking 自动制动
NavMeshAgent.autoRepath 自动重新获取路径
NavMeshAgent.autoTraverseOffMeshLink 自动穿过OffMeshLink
NavMeshAgent.avoidancePriority 逃避优先级
NavMeshAgent.baseOffset 基础偏移
NavMeshAgent.CalculatePath 计算路径
NavMeshAgent.CompleteOffMeshLink 完成分离网格链接
NavMeshAgent.currentOffMeshLinkData 当前关闭网格连接数据
NavMeshAgent.desiredVelocity 需求速度
NavMeshAgent.destination 目的地
NavMeshAgent.FindClosestEdge 寻找最近边缘
NavMeshAgent.GetAreaCost 获取区域成本
NavMeshAgent.hasPath 有路径
NavMeshAgent.height 高度
NavMeshAgent.isOnNavMesh 是否在导航网格上
NavMeshAgent.isOnOffMeshLink 是否在OffMeshLink上
NavMeshAgent.isPathStale 是否是旧路径
NavMeshAgent.Move 移动
NavMeshAgent.nextOffMeshLinkData 下一个OffMeshLink数据
NavMeshAgent.nextPosition 下个位置
NavMeshAgent.obstacleAvoidanceType 障碍逃避类型
NavMeshAgent.path 路径
NavMeshAgent.pathPending 路径等待
NavMeshAgent.pathStatus 路径状况
NavMeshAgent.radius 半径
NavMeshAgent.Raycast 射线投影
NavMeshAgent.remainingDistance 剩余距离
NavMeshAgent.ResetPath 重新设置路径
NavMeshAgent.Resume 恢复
NavMeshAgent.SamplePathPosition 样本路径位置
NavMeshAgent.SetAreaCost 设置区域成本
NavMeshAgent.SetDestination 设置目的地
NavMeshAgent.SetPath 设置路径
NavMeshAgent.speed 速度
NavMeshAgent.steeringTarget 转向目标
NavMeshAgent.Stop 刹车
NavMeshAgent.stoppingDistance 刹车距离
NavMeshAgent.updatePosition 更新位置
NavMeshAgent.updateRotation 更新旋转
NavMeshAgent.velocity 速度
NavMeshAgent.Warp 弯曲

你可能感兴趣的:(NavMeshAgent 寻路导航组件)