Skip to content

Instantly share code, notes, and snippets.

@irfanbaysal
Last active June 5, 2022 09:55
Show Gist options
  • Save irfanbaysal/b3501098f918cacd67f1dff81ca53b8d to your computer and use it in GitHub Desktop.
Save irfanbaysal/b3501098f918cacd67f1dff81ca53b8d to your computer and use it in GitHub Desktop.
Bitwise Operators by Using CullingMask
// Render everything except layer 14
camera.cullingMask = ~(1 << 14);
// Switch off layer 14, leave others as-is
camera.cullingMask &= ~(1 << 14);
Switch on layer 14, leave others as-is
camera.cullingMask |= (1 << 14);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment