用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:navmeshobstacle:navmeshobstacle

NavMeshObstacle 导航网格障碍

class in UnityEngine/Inherits from: Behaviour

Description 描述

An obstacle for NavMeshAgents to avoid.

导航网格躲避的障碍。

A NavMeshObstacle is cylindrical in shape and can move around the surface of the NavMesh with a specified velocity. By default, the obstacle will only affect the agent's avoidance behaviour rather than the pathfinding. This means that the agent will ignore the obstacle when plotting a path but will sidestep around it while moving along the path. If carving is enabled, the obstacle will create a temporary “hole” in the NavMesh. The hole will be recognised by the pathfinding, so paths will be plotted to avoid the obstacle. This means that if, say, an obstacle blocks a narrow gap, the pathfinding will seek an alternative route to the target. Without carving, the agent will head for the gap but won't be able to pass until the obstacle is clear.

导航网格障碍是圆柱形的并且可以用指定速度围绕导航网格表面移动。在默认情况下,障碍仅影响代理的躲避行为而不是寻路。这意味着当测绘路径时代理将会忽略该障碍,但是沿着路径移动时代理将会在障碍的附近回避。如果启用carving ,障碍将会在导航网格上创建一个临时的“突破口”。该突破口将会被寻路认可,因此测绘路径时将会避免该障碍。这意味着如果说障碍阻塞缺口,寻路将会寻找一个替代路线给目标。没有启用carving,代理将会朝缺口前进但是不可能通过缺口直到该障碍被清除。

Variables 变量

carveOnlyStationaryShould this obstacle be carved when it is constantly moving?
是否当障碍不断移动时可以被雕刻?
carvingShould this obstacle make a cut-out in the navmesh.
该障碍应该在导航网格中制作一张轮廓图。
carvingMoveThresholdThreshold distance for updating a moving carved hole (when carving is enabled).
临界距离适用于更新移动雕刻洞口(当雕刻被启用)。
carvingTimeToStationaryTime to wait until obstacle is treated as stationary (when carving and carveOnlyStationary are enabled).
等待时间直到障碍被处理为静止的(当carving和carveOnlyStationary被启用)。
centerThe center of the obstacle, measured in the object's local space.
障碍的中心,在对象自身空间测量。
heightHeight of the obstacle's cylinder shape.
障碍的圆柱形状的高。
radiusRadius of the obstacle's capsule shape.
障碍的胶囊形状的半径。
shapeShape of the obstacle.
障碍的形状。
sizeThe size of the obstacle, measured in the object's local space.
障碍的大小,在对象的自身空间测量。
velocityVelocity at which the obstacle moves around the NavMesh.
围绕导航网格移动的障碍的速度。
script/unityengine/classes/navmeshobstacle/navmeshobstacle.txt · 最后更改: 2016/08/02 05:30 (外部编辑)