Class LayerMaskExtensions
Extension methods for LayerMask structs.
Inherited Members
Namespace: Unity.XR.CoreUtils
Assembly: Unity.XR.CoreUtils.dll
Syntax
public static class LayerMaskExtensions
Methods
Contains(LayerMask, int)
Checks whether a layer is in a LayerMask.
Declaration
public static bool Contains(this LayerMask mask, int layer)
Parameters
| Type | Name | Description |
|---|---|---|
| LayerMask | mask | The layer mask. |
| int | layer | The layer index to check for. |
Returns
| Type | Description |
|---|---|
| bool | True if the specified layer is in this mask. |
GetFirstLayerIndex(LayerMask)
Gets the index of the first enabled layer in this layerMask.
Declaration
public static int GetFirstLayerIndex(this LayerMask layerMask)
Parameters
| Type | Name | Description |
|---|---|---|
| LayerMask | layerMask | The layer mask. |
Returns
| Type | Description |
|---|---|
| int | The index of the first enabled layer. |