Does anyone know where I can find information on SearchableEditorWindow? This class exists in the UnityEditor namespace, but there is no documentation on it. I am wanting to implement a searchable window with a search bar at the top like the hierarchy view, and it looks like this class would be the right place to start.
If not, is there a way to add the hierarchy view type search bar to the gui?
You can add a search bar to the top by using:
string searchString = "";
searchString = GUILayout.TextField(searchString, EditorStyles.toolbarTextField);
// Do comparison here. For example
for (int i = 0; i < items.Length; i++)
where “items” is an array of UnityEngine.Objects.
Yes and no. Searchable means the window is searchable. This class has a private static list which hold all references to all created windows that are derived from this type. It’s actually meant as internal call as far as i can see. Most stuff is declared as internal and you have no way to actually search for an window since there is no public function for that.
Those windows are derived from SearchableEditorWindow:
The searchable has nothing to do with the hierarchy filter at the top (well there are internal function and fields, but only to hold the current used filter). It should be actually an internal class as well since it doesn’t make much sense to derive a class from SearchableEditorWindow.
So you would have to create your own search / filter - field like @EddyEpic said. What exactly do you want to search / filter?