Additional static functions used to extend existing Layers support inside of Unity.
More...
|
static bool | ContainsLayer (this LayerMask layerMask, int targetLayer) |
| Does the layerMask contain the specified layer? More...
|
|
static int | EverythingBut (params int[] layers) |
| Create a layer mask of everything but these layers. More...
|
|
static bool | IsInLayerMask (this GameObject obj, LayerMask layerMask) |
| Checks if a GameObject is in a LayerMask. More...
|
|
static int | OnlyIncluding (params int[] layers) |
| Create a layer mask only including these layers. More...
|
|
Additional static functions used to extend existing Layers support inside of Unity.
Definition at line 38 of file Layers.cs.
static bool Hydrogen.Layers.ContainsLayer |
( |
this LayerMask |
layerMask, |
|
|
int |
targetLayer |
|
) |
| |
|
static |
Does the layerMask contain the specified layer?
- Returns
true
, if the layer is contained, false
otherwise.
- Parameters
-
layerMask | The LayerMask to poll |
targetLayer | The layer to check. |
Definition at line 46 of file Layers.cs.
48 return (layerMask.value & 1 << targetLayer) != 0;
static int Hydrogen.Layers.EverythingBut |
( |
params int[] |
layers | ) |
|
|
static |
Create a layer mask of everything but these layers.
- Returns
- A layer mask of everything but the passed layers.
- Parameters
-
layers | Array of Layer IDs. |
Definition at line 56 of file Layers.cs.
static int OnlyIncluding(params int[] layers)
Create a layer mask only including these layers.
static bool Hydrogen.Layers.IsInLayerMask |
( |
this GameObject |
obj, |
|
|
LayerMask |
layerMask |
|
) |
| |
|
static |
Checks if a GameObject is in a LayerMask.
- Parameters
-
obj | GameObject to test |
layerMask | LayerMask with all the layers to test against |
- Returns
- True if in any of the layers in the LayerMask
Definition at line 67 of file Layers.cs.
70 int objLayerMask = (1 << obj.layer);
71 return (layerMask.value & objLayerMask) > 0;
static int Hydrogen.Layers.OnlyIncluding |
( |
params int[] |
layers | ) |
|
|
static |
Create a layer mask only including these layers.
- Returns
- A layer mask including only the passed layers.
- Parameters
-
Definition at line 79 of file Layers.cs.
82 foreach (
int item
in layers) {