- Home /
Searching for the Dependents of an Asset
Hey everyone,
I am curious if there is a quick way to check an entire project for anyplace that uses a particular asset. To clarify I'm not looking for what an asset needs, but rather what objects need the asset. My project has a lot of scenes and going through each using the "Find references in scene" is a bit cumbersome. Is there a faster alternative that anyone is aware of?
Thanks, Memige
It occurs to me I could delete the asset and see what all breaks, but that seems like a rather inelegant solution.
Answer by Memige · Jan 04, 2014 at 12:02 AM
I ended up doing as I mentioned in my comment. Temporarily deleting the asset and running the game to see what breaks. As mentioned, not the most elegant of solutions, but at the moment it seems to be the only way to find the objects that use a given asset.
Please check my answer below, it should solve your problem.
Answer by Gotlight · Apr 02, 2017 at 10:24 PM
To clarify I'm not looking for what an asset needs, but rather what objects need the asset. My project has a lot of scenes and going through each using the "Find references in scene" is a bit cumbersome. Is there a faster alternative that anyone is aware of?
It occurs to me I could delete the asset and see what all breaks, but that seems like a rather inelegant solution.
Hi @Memige! It may be a bit late, but actually there is elegant solution of this problem. A tool with opposite core idea to Unity's Select Dependencies - finding assets that use particular asset.
After several major updates, an asset offers great interface for working with results and is much faster. Nested Prefab support recently added. It offers search in Project, but you can search in Scene as well.
For example, it offers:
✔ Usage search for ALL types of assets, e.g.: Scripts, Shaders, Scenes, Materials, Sprites, Prefabs, Fonts, Textures, Sounds...
✔ Search for usages in: Prefabs, Scenes, Atlases, Materials and others
✔ Exact fields that use selected asset
There is also a rapid support for the product (8-hr response/resolution time 24/7)
Asset Store link:
https://www.assetstore.unity3d.com/en/#!/content/59997
Denis
Hi can you please share the name or new URL of this asset? Unity have broken all asset store links and you haven't given enough information to find it.
Answer by Proportion1 · Nov 09, 2012 at 12:40 AM
sounds like you should be using tags.
http://docs.unity3d.com/Documentation/Components/Tags.html
just put the same tag on that perticular asset, and it will be heaps faster.
u can use Gameobject.FindWithTag("particular asset") and it will just find the one thing that has that tag.
but if u want to find all of them, for example a bunch of street lights that you wanted to turn on, u would use:
Gameobject[] streetlight = Gameobject.FindGameobjectsWithTag("street light");
this will put all the gameobjects in an array for you. then you use a foreach loop:
foreach(GameObject streetlight){ //turn on }
im not currently at a computer with unity on it but i hope this is what you were looking for.
Unfortunately that will only work for finding gameobjects at runtime that I flag ahead of time, meaning I would already have to be aware of them. I need a method that will (for example) let me find all gameobjects in the project that are using a given texture.
wouldnt you have set the texture of the object ahead of time as well? also, you can add tags to children of prefabs. so like you can make a prefab of something, put a tag on it, then add that prefab to other assets in your project and find them via tag. im guessing i dont understand the question heh.
I'm working on a large project with several people adding/changing things. One of my $$anonymous$$mmates has used some textures for a handful of objects and those textures are changing in a way that requires me to make some adjustments to the gameobjects there are attached to. I know the name of the textures, but I don't know what objects they are attached to. Thus, I need a way to search for gameobjects throughout the project that are using a specified texture.
oh i understand. i will write you an answer when i get home from work (im a photographer not a programmer heh). but on awake i'd use http://docs.unity3d.com/Documentation/ScriptReference/Object.FindObjectsOfType.html?from=GameObject to make an array of all the gameobjects, then use a foreach gameobject loop to find which gameobjects have the texture, then put each of those gameobjects in their own array. that way when you need to change the game object with that texture, they will all be in the same array. but if the textures are changing at runtime, putting something like that in update would be mega slow, unless you know the handful of objects that could possibly have that texture, then you could tag those potential objects that way you dont have to search through every object.
i will write a scrip when i get on unity (about 2 hours).
Answer by vtunity · Jun 21, 2017 at 07:05 AM
This will work For you. Once you Build a Project for Any platform unity will serialize all Reference and Generate Editor Log for a scene you place in build setting.
Then After Use this asset : https://www.assetstore.unity3d.com/en/#!/content/22983
It will Remove all Asset which is not necessary .
Your answer
![](https://koobas.hobune.stream/wayback/20220613083556im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Export Settings or custom files to release builds 1 Answer
How to change Unity remote assets folder or delete it 0 Answers
Getting assets / sub folders inside a folder 1 Answer
ScriptableObject Asset corrupted after reload of Unity 1 Answer
Teamwork with different assets purchased, is it possible ? 1 Answer