本文整理汇总了C#中QueryFilter.SetAreaCost方法的典型用法代码示例。如果您正苦于以下问题:C# QueryFilter.SetAreaCost方法的具体用法?C# QueryFilter.SetAreaCost怎么用?C# QueryFilter.SetAreaCost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryFilter
的用法示例。
在下文中一共展示了QueryFilter.SetAreaCost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeQuery
/// <summary>
/// Builds the initial query, normally called by awake
/// Can be callen manually with a different nav mesh.
/// </summary>
/// <param name="navMesh"></param>
public void InitializeQuery(Detour.NavMesh navMesh)
{
_navMeshQuery = new NavMeshQuery();
_navMeshQuery.Init(navMesh, 2048);
filter = new QueryFilter();
// These values need to me modifiable in the editor later using RecastArea
filter.IncludeFlags = 15;
filter.ExcludeFlags = 0;
filter.SetAreaCost(1, 1.0f);
filter.SetAreaCost(2, 10.0f);
filter.SetAreaCost(3, 1.0f);
filter.SetAreaCost(4, 1.0f);
filter.SetAreaCost(5, 2);
filter.SetAreaCost(6, 1.5f);
}