The Unity Search Workflow is really rich and allows a lot of different workflows. But sometimes people forget that the Search backend can be scripted to add even more power to it. The current Unity Manual for search will be updated for 23.3 but I feel a lot of the APIs allowing you to customize Search are difficult to find (unless you crawl the Unity Script API pages by yourself).
As a (small) Christmas gift I decided to give you a bunch of articles helping you get even more control on search. I will try to post one article per day until the start of my Christmas break (December 22th).
All articles can be found here:
For those who do not know, the SearchExtensions package is a repository of examples and prototypes using the back of the Search system.
The article of the day is about Asset Custom Indexing or how YOU can decide how asset properties can be indexed.
Is it viable for an editor tool to use the search API to classify selectable objects?
For example if I work with a grid and I want all floor tiles listed in a window, I could define a search scheme (labels, naming, tag component or similar). What would be some pros/cons over the classic approach where you’d provide or expect users to drop the floor tiles in one list, wall tiles in another list respectively just placing them in specific folders?
What is the gift that keep on giving? More Search knowledge of course. This article is how to get the most out of the Advanced Picker workflow in Unity:
Although, in my current project that’s approaching 500gb, I can’t use the new search to full potential because indexing take so much time. Is there anytip on how to optimize indexing?
I currently have to disable indexing in my project but I still use search because the saved search query is still very handy!
This is great stuff! The first time I tried out the new search tool I was overwhelmed and the manual wasn’t really helping, so after an hour trying to wrap my head around it I’ve never used it again. Will definitely have another look now. Especially the table editing seems very powerful!
You project is epically big. Here are some tips to help with indexing:
You can tweak what needs to be indexed. If you know you have folders contaning assets that have know value in being indexed (like psd) I suggest you create your own index file and exclude these folders.
Indexing properties and extended can be long: you can exclude these options. I suggest you keep indexing type and dependencies since searching by ref is a nice workflow.
You can also create multiple indices in your project. If you know that some folders full of assets (textures?) are not chaning often, you can create an index for this folder (any index file at the root of a folder will index recursively all assets in that folder. And create other indexes for assets that change more often. This way indexing will mostly affect fixes that change often.
In my test project I have multiple indices, each with different settings:
If you like the Search window and the posibility to save query on disk and you feel like indexing is not usable at all you can:
Remove all index settings from your project (and delete the default one created in UserSettings.
Use the Search window with the “ADB PRovider” enabled:
The ADB provider is connected to the AssetDatabase (same search engine as the Project Browser. This would still allow you to have a collection like workflow and save multiple SearchQuery in your project but searching would use AssetDatabase instead. You can still setup Table and save them in SearchQuery. I feel that even if in this workflow you wouldn’t have properties being indexed you could still benefit from the User Experience that the Search Window provide.
Here is a Table View I setup using the ADB provider and allowing to view and edit mesh and Cast Shadows properties:
Hope this helps. The “find” provider could be interesting for you as well, it searches by file name and supports glob and regex searching. All its search is fully threaded and you be fairly quick even in big project.
You are right that the Search Window can be intimidating at first. It is difficult to find the right balance between ease of use and powerful workflow. I hope these articles I wrote can help “harness” the power of the Search workflow
Does the tool support “reverse search”? For example, does it show me all the materials where a specific texture (the texture I search for) is used?