Skip to content

Instantly share code, notes, and snippets.

@yordis
Last active July 2, 2017 00:29
Show Gist options
  • Save yordis/78f841791001ade22ef0 to your computer and use it in GitHub Desktop.
Save yordis/78f841791001ade22ef0 to your computer and use it in GitHub Desktop.
Unity

Unity Scripts

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