2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Unity】フォルダ内のプレハブ群とシーン群からTagとLayerの利用箇所を検索できるEditor拡張

Posted at

概要

見覚えのない Tag や Layer の利用状況をより詳しく把握できるEditor拡張を作りました。

Tag And Layer に作った覚えのない Tag や Layer が増えている経験はありませんか?
大抵、ライブラリのサンプルやチームメンバーによって追加されます。
IDE の検索機能を使えば、コード内でどのように Tag や Layer が使われているか調べられますが、Unity 上での利用状況は調べられません。
そこで、フォルダ内のプレハブ群とシーン群が持つ全てのオブジェクトから、特定のタグ・レイヤーが利用されているオブジェクトを探して列挙するEditor拡張を作りました。
具体的な利用箇所もパスで見つけやすくなっています。

image.png

もし開発初期に使用予定の無さそうな Tag や Layer を見つけたら、メンバーに確認を取って削除しましょう。不必要な Tag と Layer は自身や開発メンバーを混乱させたり、思わぬ不具合の原因になったりします。

コード

使い方

  1. コードをプロジェクトに追加します
  2. メニューバーから Tools → Utility → Open FindTagAndLayerUserEditor を選択します
  3. 調べたいフォルダをクリックします
  4. タグ名・レイヤー名を指定して Find ボタンを押します
  5. 少し待ちます
  6. コンソールに使用個数と使用しているプレハブ・シーンのパスが表示されます
2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?