Periksa objek ada di Layermask Unity

public bool IsInLayerMask(GameObject obj, LayerMask layerMask)
{
	return ((layerMask.value & (1 << obj.layer)) > 0);
}
Legion