I have a script defining a scriptable Object, and I created various assets from it. After this, I sorted them in various folders in my project. (note: they are not necessarily used on a given scene)
Is there a way to find them all using the search functionnalities of the editor ? (ex: “Find object of type” rather than “Find references in scene”)?
I would rather NOT use the label functionnalities, as I may easily forget to set it after creating such a scriptable object.
Sorry if I have been clear enough. I am NOT looking for a way to find assets using scripts. I am looking for a solution using Editor only.
Here is the “scenario” I am facing :
I create a script defining a ScriptableObject (ex: supercarDefinition.cs defines “SuperCar : ScriptableObject”
Using the [CreateAssetMenu] from the editor, I then create 12 scriptable objects assets (= files) of SuperCar which are properly renamed (“Ferrari Enzo”, “Porsche 911”, etc…)
In my project, my folder/file tree is very big, so let’s say I don’t really remember where all these 12 files are stored.
Now, let’s say I add a new variable to the script (ex; “maxSpeed”). Now my 12 existing superCars have an empty field which I need to fill.
… How can I find the 12 files ?
the filename does not include “SuperCar”, so I cannot use the search bar with the name
the “type” is a ScriptableObject, which does not exist in the default type.
Types that derive from ScriptableObject must use the file-name as class-name, otherwise serialization is going to behave in unexpected ways for assets of that type. Typical symptom would be that values are lost when restarting the editor.
You search the Project View using SuperCar as type argument. You’d enter the following search text in Project View search field:
Notice the “t:” prefix. This instructs Unity’s search engine to look for assets of the specific type, rather than names and it will display all assets in the project of type SuperCar. However, as I wrote in my previous comment, searching for types is sometimes not working properly. Unity’s search is affected by this bug as well.
Just ran into this. It literally stops working if the type is renamed, even when searching for the correct one. In my case, I changed the namespace of the class. Now it can’t find it anymore with the fully qualified class name.
t:ProjectName.SomeNamespace.TheType does no longer work, only t:TheType does. But that’s not an option for me, because I have types with the same names in different namespaces, so that’s a no-go. I have no idea how to resolve this now. I’m not using FindAssets(), though, but SearchService.Request(). Not sure if that makes any difference.