0
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 3 years have passed since last update.

スクリプトがアタッチされているオブジェクトを探す方法

Posted at

##0.0 はじめに
Script(スクリプト)がコンポーネントとしてアタッチされているObject(オブジェクト)を探す方法です。
間違ってアタッチしたScriptがどこかで動いてエラーを出しているって時に役に立ちます。

##1.0 初心者
単純に対象のScriptのStart()に Debug.Log($"私は {name} です"); と書いておけばConsole(コンソール)画面にオブジェクトの名前が表示されます。

##2.0 プロフェッショナル
Project内にある対象のScriptを右クリックすると出てくるFind References In Sceneを使います。
Hierarchyに対象のScriptがアタッチされたオブジェクトが出ています。

👍ポイント
このFind References In SceneはScript以外でも使用可能です。特定のPrefabを使用しているObjectを探すこともできます。

image.png

0
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
0
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?