GibTreaty

LayerMaskExtensions.cs

Aug 1st, 2015
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public static class LayerMaskExtensions {
  5.     public static bool LayerInMask(this LayerMask layerMask, int layer) {
  6.         return (layerMask & (1 << layer)) > 0;
  7.     }
  8.     public static bool LayerInMask(this LayerMask layerMask, GameObject gameObject) {
  9.         return (layerMask & (1 << gameObject.layer)) > 0;
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment