Class NavMeshModifier
Component that modifies the properties of the GameObjects used for building a NavMesh.
Namespace: Unity.AI.Navigation
Syntax
public class NavMeshModifier : MonoBehaviour
Remarks
The properties apply to the current GameObject and 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> |
area
Gets or sets the area type applied by this GameObject.
Declaration
public int area { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
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
See Also
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 |
---|---|
Boolean |
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 |
---|---|
Boolean |
Remarks
The area type information is used when baking the NavMesh.
See Also
Methods
AffectsAgentType(Int32)
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 |
---|---|---|
Int32 | agentTypeID | The identifier of an agent type that originates from |
Returns
Type | Description |
---|---|
Boolean |
|