Version: 2017.2

NavMeshObstacle

class in UnityEngine.AI

/

Hereda de:Behaviour

Cambiar al Manual

Descripción

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.

See Also: NavMeshAgent.

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).
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.
shapeThe shape of the obstacle.
sizeThe size of the obstacle, measured in the object's local space.
velocityVelocity at which the obstacle moves around the NavMesh.

Miembros heredados

Variables

enabledEnabled Behaviours are Updated, disabled Behaviours are not.
isActiveAndEnabledHas the Behaviour had enabled called.
gameObjectEl game object que tiene este componente adjunto. Un componente siempre está adjunto a un game object.
tagEl tag de este game object.
transformThe Transform attached to this GameObject.
hideFlags¿Debería el objeto estar oculto, guardado con la escena o modificable por el usuario?
nameEl nombre del objeto.

Funciones Públicas

BroadcastMessageLlama al método denominado methodName de todos los MonoBehaviour en este game objecto en cualquiera de sus hijos.
CompareTag¿Este game object está etiquetado con tag?
GetComponentDevuelve un componente de tipo type si el game object tiene a alguno adjuntado, o null si no lo tiene.
GetComponentInChildrenRetorna el componente de tipo type en el GameObject o cualquiera de sus hijos utilizando depth first search (busqueda de profundidad).
GetComponentInParentRetorna el componente de tipo type en el GameObject o cualquiera de sus padres.
GetComponentsRetorna todos los componentes de tipo type en el GameObject.
GetComponentsInChildrenRetorna todos los componentes de tipo type en el GameObject o cualquiera de sus hijo.
GetComponentsInParentRetorna todos los componentes de tipo type en el GameObject o cualquiera de sus padres.
SendMessageLlama al método denominado methodName en cada MonoBehaviour de este game object.
SendMessageUpwardsLlama al método denominado methodName en todos los MonoBehaviour de este juego y en todos los ancestros del behaviour.
GetInstanceIDDevuelve el id de la instancia del objeto.
ToStringDevuelve el nombre del objeto.

Funciones Estáticas

DestroyElimina un gameobject, componente o asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadHace que el objeto target no sea destruido automáticamente cuando se cargue una nueva escena.
FindObjectOfTypeDevuelve el primer objeto activo cargado de tipo type.
FindObjectsOfTypeDevuelve una lista de todos los objetos activos cargados de tipo type.
InstantiateClona el objeto original y devuelve el clon.

Operadores

bool¿Existe el objeto?
operator !=Compare si dos objetos se refieren a un objeto diferente.
operator ==Compara dos referencias de objeto para ver si se refieren al mismo objeto.