Class NavMeshModifier
Component that modifies the properties of the GameObjects used for building a NavMesh.
Inherited Members
Namespace: Unity.AI.Navigation
Assembly: Unity.AI.Navigation.dll
Syntax
[ExecuteAlways]
[DefaultExecutionOrder(-103)]
[AddComponentMenu("Navigation/NavMesh Modifier", 32)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.ai.navigation@2.0/manual/NavMeshModifier.html")]
public class NavMeshModifier : MonoBehaviour
Remarks
The properties apply to the current GameObject and can be optionally applied recursively to all its children in the hierarchy. This modifier overrides the properties set to this GameObject by any other NavMeshModifier in the parent hierarchy.
Properties
activeModifiers
Gets the list of all the NavMeshModifier components that are currently active in the scene.
Declaration
public static List<NavMeshModifier> activeModifiers { get; }
Property Value
Type | Description |
---|---|
List<NavMeshModifier> |
applyToChildren
Gets or sets whether this GameObject's children also use the modifier settings.
Declaration
public bool applyToChildren { get; set; }
Property Value
Type | Description |
---|---|
bool |
area
Gets or sets the area type applied by this GameObject.
Declaration
public int area { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
The range of useful values is from 0 to 31. Higher values always take precedence over lower values in the case when the surfaces of more GameObjects intersect each other to produce a NavMesh in the same region. A value of 1 has the highest priority over all the other types and it means "not walkable". Consequently, the surface of a GameObject with an area
of 1 produces a hole in the NavMesh. This property has the same meaning as area.
See Also
generateLinks
Gets or sets whether this object is included in the link generation process.
Declaration
public bool generateLinks { get; set; }
Property Value
Type | Description |
---|---|
bool |
ignoreFromBuild
Gets or sets whether the NavMesh building process ignores this GameObject and its children.
Declaration
public bool ignoreFromBuild { get; set; }
Property Value
Type | Description |
---|---|
bool |
overrideArea
Gets or sets whether to assign the area type to this object instead of the defaultArea.
Declaration
public bool overrideArea { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The area type information is used when baking the NavMesh.
See Also
overrideGenerateLinks
Gets or sets whether the default links generation condition for the GameObject and its children should be overridden.
Declaration
public bool overrideGenerateLinks { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
AffectsAgentType(int)
Verifies whether this modifier can affect in any way the generation of a NavMesh for a given agent type.
Declaration
public bool AffectsAgentType(int agentTypeID)
Parameters
Type | Name | Description |
---|---|---|
int | agentTypeID | The identifier of an agent type that originates from agentTypeID. |
Returns
Type | Description |
---|---|
bool |
|