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

NavMeshQuery.BeginFindPath

Cambiar al Manual
public Experimental.AI.PathQueryStatus BeginFindPath (Experimental.AI.NavMeshLocation start, Experimental.AI.NavMeshLocation end, int areaMask, NativeArray<float> costs);

Parámetros

costsArray of custom cost values for all of the 32 possible area types. Each value must be at least 1.0f. This parameter is optional and defaults to the area costs configured in the project settings. See Also: NavMesh.GetAreaCost.
areaMaskBitmask with values of 1 set at the indices for areas that can be traversed, and values of 0 for areas that are not traversable. This parameter is optional and defaults to NavMesh.AllAreas, if omitted. See Also: Areas and Costs.
startThe start location on the NavMesh for the path.
endThe location on the NavMesh where the path ends.

Valor de retorno

PathQueryStatus InProgress if the operation was successful and the query is ready to search for a path.
Failure if the query's NavMeshWorld or any of the received parameters are no longer valid.

Descripción

Initiates a pathfinding operation between two locations on the NavMesh.

The path always begins at the specified location. If the desired end location is not directly accessible, the search algorithm tries to find a valid location nearby.
Calling this method overrides the progress made by this NavMeshQuery in the previous pathfinding operation.

NavMeshQuery.UpdateFindPath should be called after this method to process the path search.

See Also: PathQueryStatus.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961