Firstborn/Assets/AwesomeTechnologies/VegetationStudioPro/Runtime/Utility/Extentions/LayerMaskExtention.cs

21 lines
496 B
C#
Raw Normal View History

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));
}
}
}