The procedural NavAreas
script contains constants corresponding to the value of each navigation area in your project, including any custom areas so that instead of NavMesh.GetAreaFromName("Walkable")
you can use Weaver.NavAreas.Walkable
.
Navigation Areas Panel
The Navigation Areas panel in the Weaver Window allows the procedural script to be entirely disabled and shows the following options for customising it (Pro-Only):
Option | Description |
---|---|
Custom Navigation Area Masks | You can create custom navigation area masks which include specific areas. Each mask will be added to the script as an additional constant. |
Include Areas | If enabled, the script will include constants corresponding to the index of each area. |
Include Area Masks | If enabled, the script will include constants corresponding to the bit mask of each area (1 << AreaValue ). |
Sample Output
// This file was procedurally generated by Weaver. Any modifications will be overwritten.
#pragma warning disable // All.
namespace Weaver
{
/// <summary>This class was procedurally generated by Weaver.</summary>
public static class NavAreas
{
#region Nav Areas -> Window/Navigation
/// <summary>Walkable (Mask Value = 1)</summary>
public const int Walkable = 0;
/// <summary>Not Walkable (Mask Value = 2)</summary>
public const int NotWalkable = 1;
/// <summary>Jump (Mask Value = 4)</summary>
public const int Jump = 2;
/// <summary>Shallow Water (Mask Value = 8)</summary>
public const int ShallowWater = 3;
/// <summary>Deep Water (Mask Value = 16)</summary>
public const int DeepWater = 4;
#endregion
#region Custom Nav Area Masks -> Window/General/Weaver
/// <summary>LandUnit (Mask Value: 13)</summary>
public const int LandUnitMask = (1 << Walkable) | (1 << Jump) | (1 << ShallowWater);
/// <summary>AirUnit (Mask Value: 31)</summary>
public const int AirUnitMask = (1 << Walkable) | (1 << NotWalkable) | (1 << Jump) | (1 << ShallowWater) | (1 << DeepWater);
/// <summary>SeaUnit (Mask Value: 24)</summary>
public const int SeaUnitMask = (1 << ShallowWater) | (1 << DeepWater);
#endregion
}
}