NavMeshAgent.SetLayerCost
SetLayerCost(layer: int, cost: float): void;
Parameters

layer Layer index.
cost New cost for the specified layer.
Description

Sets the cost for traversing over geometry of the layer type.

If you enable or disable the agent then the cost will be reset to the default layer cost.