Class NavMeshModifierVolume
Component used by the NavMesh building process to assign a different area type to the region inside the specified volume.
Inherited Members
Namespace: Unity.AI.Navigation
Assembly: Unity.AI.Navigation.dll
Syntax
[ExecuteAlways]
[AddComponentMenu("Navigation/NavMesh Modifier Volume", 31)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.ai.navigation@2.0/manual/NavMeshModifierVolume.html")]
public class NavMeshModifierVolume : MonoBehaviour
Properties
activeModifiers
Gets the list of all the NavMeshModifierVolume components that are currently active in the scene.
Declaration
public static List<NavMeshModifierVolume> activeModifiers { get; }
Property Value
Type | Description |
---|---|
List<NavMeshModifierVolume> |
area
Gets or sets the area type that will be enforced by the volume during the generation of the NavMesh.
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 more volumes intersect each other. A value of 1 has the highest priority over all the other types and it means "not walkable". Consequently, a volume with an area
of 1 produces a hole in the NavMesh. This property has the same meaning as area.
See Also
center
Gets or sets the center position of the modifier volume.
Declaration
public Vector3 center { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
The position is relative to the GameObject transform.
size
Gets or sets the dimensions of the cuboid modifier volume.
Declaration
public Vector3 size { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
The dimensions apply in the local space of the GameObject.
Methods
AffectsAgentType(int)
Verifies whether this modifier volume 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 |
|