Nav3DPath: Pathfinding - Nav3D Doc

Docy Child

Nav3DPath: Поиск пути

To perform pathfinding you need to do: 

  1. Создать экземпляр Nav3DPath используя конструктор: new Nav3DPath().
  2. Для созданного объекта Nav3DPath вызовите один из методов:

Для поиска пути между двумя точками:

				
					public void Find(
Vector3 _Start,
Vector3 _End,
Action _OnSuccess = null,
Action<PathfindingError> _OnFail = null
)
				
			

Назначение параметров:

  • Action _OnSuccess - колбэк успешного завершения поиска пути.
  • Action<PathfindingError> _OnFail - колбек завершения поиска пути в случае ошибки, содержит данные об ошибке.

Для поиска пути между множеством точек (больше 2):

				
					public void Find(
       Vector3[] _Goals,
       bool _Loop,
       bool _SkipUnpassableGoals = false,
       Action _OnSuccess = null,
       Action<PathfindingError> _OnFail = null
   )

				
			

Назначение параметров:

  • bool _Loop - нужно ли замкнуть путь (будет найден путь между первой и последней точкой в наборе).
  • bool _SkipUnpassableGoals = false - будет ли пропускаться каждая точка, до которой поиск пути завершился с ошибкой. Если параметр установлен в false, то при неудаче поиска пути между любой парой точек, будет выполнен _OnFail колбэк, и поиск будет прекращен.

Имеется возможность повторить последний поиск пути. Это может быть полезно, если вы считаете, что последний найденный путь больше не актуален, например в случае, если изменилась конфигурация сцены (какие-либо препятствия были добавлены или удалены).

Для этого вызовите метод public void Update() .

Nav3DSphereShell

Represents a spherical shell that is perceived by other agents as an object to a...

Nav3DEvader

There is also a separate controller, whose behavior consists of just avoiding ne...

Nav3DAgentManager

This class implements several methods to get a list of all Nav3DAgents located i...

Nav3DPathTester

We implemented a useful component (Nav3DPathTester), which can be used while bui...

PathfindingResult

Contains the pathfinding data and time statistics. Time statistics: public TimeS...

Nav3DPath: События

For the convenience of notification when the pathfinding finished, the following...

Лог агента

Here you can copy the contents of the agent log to the clipboard by clicking the...

Debug drawing

In this section, you can visualize the agent and his nearest environment. This s...

Создание и настройка описания агента из кода

All Nav3DAgentDescription parameters configured in the description inspector c...

Nav3DManager

Nav3DManager is a helper static class. Can be useful for checking whether Nav3D ...

Nav3DInitializer

To use Nav3D in playmode, you need to initialize it. The Nav3DInitializer compon...

Nav3DObstacleLoader

To use the possibility of pre-baking obstacles on the scene in editor mode and t...

Chat Icon Close Icon
ru_RURussian