Unity Scripts
Last active
July 2, 2017 00:29
-
-
Save yordis/78f841791001ade22ef0 to your computer and use it in GitHub Desktop.
Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class Extensions { | |
public static bool IsInLayerMask(this LayerMask mask, GameObject obj) { | |
return IsInLayerMask (mask, obj.layer); | |
} | |
public static bool IsInLayerMask(this LayerMask mask, int layer) { | |
return (mask.value & 1 << layer) > 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment