In Unity Editor, can you show what game-object/prefabs are using scripts?

I understand this is not a beginning unity course. However, before explaining scripts, can you show in unity editor that: what game-object/prefabs are using scripts? If you do not show, I just can find them in the hierarchy, but cannot find them in prefab if there is not an instance of that prefab in the hierarchy.
For example: Inventory.cs, InventoryUI.cs
Showing scripts in the hierarchy helps me a lot to understand the basic of scripts.

I know that Jetbrains (maker of Rider, IntelliJ, Pycharm, etc) makes a plugin for Unity (free on the Unity Asset Store) that is supposed to be able to do this. It might not work on all versions of Unity.

I have not tested it though.

Super late response but yes, here’s the Syntax Search Cheat Sheet if someone ever needs it:

https://docs.unity3d.com/Packages/com.unity.quicksearch@2.1/manual/search-syntax.html

Here’s a small gif, in this example I’m searching for the components that have the Tower script attached, t: searches all game objects who have a component containing the word you write, in this case is ‘tower’.

ezgif-3-1e36c83cde

The built-in CodeLens in the free Visual Studio 2022 Community Edition does this as well. (with Visual Studio for Unity properly set up. The default settings does it automatically.)

On top of the class, it shows “Unity Script” and the number of references. Clicking on it shows the names of the assets using it (scenes or prefabs or other assets). Double-clicking on an entry highlights the object in Unity.

image

I’m not sure if VS Code has the same thing. I think Sam had his CodeLens turned off to reduce clutter on the screen for the lesson.

Privacy & Terms