Version: 2017.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NavMeshBuilder.CollectSources

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

For convenience, you can create a list of build sources directly from the current geometry.

The collection can be controlled in terms of layers, type of geometry and by collecting either by hierarchy or volume.


public static method CollectSources(includedWorldBounds: Bounds, includedLayerMask: int, geometry: AI.NavMeshCollectGeometry, defaultArea: int, markups: List<NavMeshBuildMarkup>, results: List<NavMeshBuildSource>): void;
public static void CollectSources(Bounds includedWorldBounds, int includedLayerMask, AI.NavMeshCollectGeometry geometry, int defaultArea, List<NavMeshBuildMarkup> markups, List<NavMeshBuildSource> results);

Parameters

includedWorldBoundsThe queried objects must overlap these bounds to be included in the results.
includedLayerMaskSpecifies which layers are included in the query.
geometryWhich type of geometry to collect - e.g. physics colliders.
defaultAreaArea type to assign to results, unless modified by NavMeshMarkup.
markupsList of markups which allows finer control over how objects are collected.
resultsList where results are stored, the list is cleared at the beginning of the call.

Description

Collects renderers or physics colliders, and terrains within a volume.


public static method CollectSources(root: Transform, includedLayerMask: int, geometry: AI.NavMeshCollectGeometry, defaultArea: int, markups: List<NavMeshBuildMarkup>, results: List<NavMeshBuildSource>): void;
public static void CollectSources(Transform root, int includedLayerMask, AI.NavMeshCollectGeometry geometry, int defaultArea, List<NavMeshBuildMarkup> markups, List<NavMeshBuildSource> results);

Parameters

rootIf not null, consider only root and its children in the query; if null, includes everything loaded.
includedLayerMaskSpecifies which layers are included in the query.
geometryWhich type of geometry to collect - e.g. physics colliders.
defaultAreaArea type to assign to results, unless modified by NavMeshMarkup.
markupsList of markups which allows finer control over how objects are collected.
resultsList where results are stored, the list is cleared at the beginning of the call.

Description

Collects renderers or physics colliders, and terrains within a transform hierarchy.