文档

Unity Engine

Unity Engine

GetAreaCost(int)

Gets the cost for path finding over geometry of the area type.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine.AI
  • Assembly: UnityEngine.AIModule
public static float GetAreaCost(int areaIndex)

Parameters

areaIndex

Index of the area to get.

Returns

Type

Description

float

Remarks

The value applies to all agents unless the value has been customized per agent by calling NavMeshAgent.SetAreaCost.
Use NavMesh.GetAreaFromName to find the area index based on the name of the NavMesh area type.
Additional Resources: Areas and Costs