21 lines
496 B
C#
21 lines
496 B
C#
|
using UnityEngine;
|
|||
|
|
|||
|
namespace AwesomeTechnologies.Utility.Extentions
|
|||
|
{
|
|||
|
public static class LayerMaskExtention
|
|||
|
{
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Extension method to check if a layer is in a layermask
|
|||
|
/// </summary>
|
|||
|
/// <param name="mask"></param>
|
|||
|
/// <param name="layer"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static bool Contains(this LayerMask mask, int layer)
|
|||
|
{
|
|||
|
return mask == (mask | (1 << layer));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|