Version: 2023.2

NavMesh.GetAreaCost

切换到手册
public static float GetAreaCost (int areaIndex);

参数

areaIndex 要获取的区域的索引。

描述

获取区域类型几何体的寻路成本。

该值适用于所有代理,除非您通过调用 NavMeshAgent.SetAreaCost 为每个代理自定义了该值。

Use GetAreaFromName to find the area index based on the name of the NavMesh area type.

另请参阅:Areas and Costs,了解如何使用不同的区域类型。

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