Internally stores a unsigned long to be able to toggle 64 different regions. More...
Inherits IEquatable< NavMeshRegionMask >.
Public Member Functions | |
NavMeshRegionMask (ulong regions) | |
Constructor. More... | |
void | Clear () |
This sets all regions to active. More... | |
bool | IsRegionEnabled (int region) |
Check if a region is active. More... | |
bool | IsSubset (NavMeshRegionMask other) |
Check if the region mask is included inside the other. More... | |
bool | IsSuperset (NavMeshRegionMask other) |
Check is the region mask of other is included in ours. More... | |
void | ToggleRegion (int region, bool enabled) |
Toggle a region by id (or index). More... | |
Static Public Member Functions | |
static NavMeshRegionMask | Combine (NavMeshRegionMask a, NavMeshRegionMask b) |
Combine two region masks. More... | |
Public Attributes | |
bool | HasValidRegions => _regions != 0 |
Returns true, when the mask has exactly one valid region set. More... | |
bool | IsMainArea => _regions == 0 |
Checks if the mask is zero which will be true for triangles belonging to the main navmesh area and cannot be toggled off. More... | |
ulong | Mask => _regions |
Access to underlying bit mask. More... | |
Static Public Attributes | |
static NavMeshRegionMask | Default => new NavMeshRegionMask(~0UL) |
All regions toggled on. More... | |
Internally stores a unsigned long to be able to toggle 64 different regions.
When instantiating a NavMeshRegionMask, all regions are toggled off.
Use Default to create a mask with all regions toggled on.
|
inline |
Constructor.
regions | Raw region mask |
|
inlinestatic |
Combine two region masks.
a | A |
b | B |
|
inline |
Toggle a region by id (or index).
region | Region id (defined by the region list inside the Map) |
enabled | Toggle region on or off |
|
inline |
Check if a region is active.
region | Region id (or index) |
|
inline |
Check if the region mask is included inside the other.
other | Other mask, usually the one from Frame |
|
inline |
Check is the region mask of other is included in ours.
other | Other region mask |
|
inline |
This sets all regions to active.
|
static |
All regions toggled on.
bool Quantum.NavMeshRegionMask.HasValidRegions => _regions != 0 |
Returns true, when the mask has exactly one valid region set.
bool Quantum.NavMeshRegionMask.IsMainArea => _regions == 0 |
Checks if the mask is zero which will be true for triangles belonging to the main navmesh area and cannot be toggled off.
ulong Quantum.NavMeshRegionMask.Mask => _regions |
Access to underlying bit mask.