Experimental: this API is experimental and might be changed or removed in the future.

NavMeshQuery.UpdateFindPath

Switch to Manual
public Experimental.AI.PathQueryStatus UpdateFindPath (int iterations, out int iterationsPerformed);

Parameters

iterations在此调用期间搜索算法遍历的最大节点数。
iterationsPerformed输出在此调用期间已遍历的实际节点数。

Returns

PathQueryStatus InProgress if the search needs to continue further by calling UpdateFindPath again.
Success if the search is completed and a path has been found or not.
Failure if the search for the desired position could not be completed because the NavMesh has changed significantly since the search was initiated.
Additionally the returned value can contain the OutOfNodes flag when the pathNodePoolSize parameter for the NavMeshQuery initialization was not large enough to accommodate the search space.

Description

继续进行正在进行的路径搜索。

此操作需要先前使用 NavMeshQuery.BeginFindPath 进行初始化,它将一直运行,直到找到整个路径或执行了指定的迭代次数为止。

只要先前调用返回了 InProgress 的状态,就可以跨不同的帧重复调用此方法,直到操作成功为止。随后使用 NavMeshQuery.EndFindPath 准备要检索的路径数据以及所包含的节点数量。

另请参阅:PathQueryStatus