FCV Engine 0.1
A tool and framework for tutorials in game development
Loading...
Searching...
No Matches
LayerMaskUtility Class Reference

A utility class for working with LayerMasks in Unity. Includes functions to check if a GameObject or a layer is part of a specified LayerMask. More...

Static Public Member Functions

static bool IsInLayerMask (GameObject obj, LayerMask mask)
 Checks if a GameObject is in the specified LayerMask.
 
static bool IsInLayerMask (int layer, LayerMask mask)
 Checks if a layer is in the specified LayerMask.
 

Detailed Description

A utility class for working with LayerMasks in Unity. Includes functions to check if a GameObject or a layer is part of a specified LayerMask.

Definition at line 9 of file LayerMaskUtility.cs.

Member Function Documentation

◆ IsInLayerMask() [1/2]

static bool IsInLayerMask ( GameObject obj,
LayerMask mask )
static

Checks if a GameObject is in the specified LayerMask.

Parameters
objThe GameObject to check.
maskThe LayerMask to check against.
Returns
True if the GameObject is in the specified LayerMask, otherwise false.

◆ IsInLayerMask() [2/2]

static bool IsInLayerMask ( int layer,
LayerMask mask )
static

Checks if a layer is in the specified LayerMask.

Parameters
layerThe layer index to check.
maskThe LayerMask to check against.
Returns
True if the layer is in the specified LayerMask, otherwise false.

The documentation for this class was generated from the following file: