Finding Assets/Prefabs That Are Not In The Scene

Hey,

I have a list of modular GameObjects that I want the user to user to be able to select from and various scripts to spawn. Currently I have it set up so every GameObject is assigned to a variable in the inspector. This results is a large and painful list of variables under the script.

Is there is a way of searching through all your assets for a specific tag and then searching through that list/array for something even more specific, like the Name of the object?

This would save me a lot of time, and make everything more future proof. There must be some sort of trick for searching though a group of assets that are not in the scene, rather than assigning them all individually in the inspector.

Also answers in Javascript would be preferred :slight_smile:
Many thanks,

Magnus

Well no not really :frowning: The only other way is to include them in a Resources folder and then get them from there. However, there is no way of enumerating the contents of a Resources folder.

What I do is create a script that acts as scene resources which I can search on by name. This is basically a big array and I assign all of the relevant prefabs to it - which is at least just a big drag and drop operation rather than finding everything and assigning it individually.