Created
January 9, 2018 02:28
-
-
Save partlyhuman/50b3758e2c202fcdc9ccfef8bb1d57bc to your computer and use it in GitHub Desktop.
Find all references to Unity object
This file contains hidden or 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
#!/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