Skip to content

Instantly share code, notes, and snippets.

@partlyhuman
Created January 9, 2018 02:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save partlyhuman/50b3758e2c202fcdc9ccfef8bb1d57bc to your computer and use it in GitHub Desktop.
Save partlyhuman/50b3758e2c202fcdc9ccfef8bb1d57bc to your computer and use it in GitHub Desktop.
Find all references to Unity object
#!/bin/bash
# usage: send path of an asset in. the script will find the GUID from the associated meta file, and look for usages of this GUID anywhere.
# of course only works with text mode (YAML) serialization
GUID=$(grep -Po '(?<=guid: )\w+' $1.meta)
echo "Object has GUID $GUID"
echo "Searching for instances..."
find . \( -name "*.asset" -o -name "*.prefab" -o -name "*.unity" \) -exec grep -l $GUID {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment