Skip to content

Instantly share code, notes, and snippets.

@michaelbartnett
Last active January 30, 2017 17:05
Show Gist options
  • Save michaelbartnett/88dabe6460b0d00ae844e0d786cf0071 to your computer and use it in GitHub Desktop.
Save michaelbartnett/88dabe6460b0d00ae844e0d786cf0071 to your computer and use it in GitHub Desktop.
List unused layers in a Unity project that uses text serialization
ag --nobreak --nofilename --nogroup '\Wm_Layer: \d+$' |
sed -E 's/[ \t]*m_Layer: ([0-9]+)/\1/g' |
python3 -c 'import sys; \
used_layers = frozenset(map(int, sys.stdin.readlines())); \
free_layers = sorted([layer for layer in (frozenset(range(32)) - used_layers) if layer > 7]); \
print("Free layers:", ", ".join(map(str, free_layers)))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment