LoginSignup
1
3

More than 5 years have passed since last update.

Unity でスクリプトやプレハブを参照しているプレハブを検索する

Posted at

はじめに

  • Unity でスクリプトやプレハブの meta ファイルに記載されている guid を利用して参照しているプレハブを検索するコマンドのメモ
  • mac で Unity の meta のフォーマットが force text に設定されている環境を想定している

コード

find-prefab.sh
#!/bin/sh
GUID=$(find . -name ${1}.meta | xargs perl -lne 'if (m/guid: (.*)/) { print $1; }')
find . -name '*.prefab' | xargs -n 10 grep $GUID 2>/dev/null

つかいかた

  • スクリプトやプレハブの名前を渡して検索する
$ find-prefab.sh UILabel.cs
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3