class in UnityEditor.Search
Implements interfaces:ISerializationCallbackReceiver
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloseSearch view state is used to create new Search windows. See SearchService.ShowWindow.
using UnityEditor; using UnityEditor.Search; using UnityEngine.Search;
static class SearchWindows { [MenuItem("Search/Views/Simple Search Bar 1")] public static void SearchViewFlags1() => CreateWindow(SearchViewFlags.None); [MenuItem("Search/Views/Simple Search Bar 2")] public static void SearchViewFlags2() => CreateWindow(SearchViewFlags.EnableSearchQuery); [MenuItem("Search/Views/Simple Search Bar 3")] public static void SearchViewFlags3() => CreateWindow(SearchViewFlags.DisableInspectorPreview); [MenuItem("Search/Views/Simple Search Bar 4")] public static void SearchViewFlags4() => CreateWindow(SearchViewFlags.EnableSearchQuery | SearchViewFlags.DisableInspectorPreview);
static void CreateWindow(SearchViewFlags flags) { var searchContext = SearchService.CreateContext(string.Empty); var viewArgs = new SearchViewState(searchContext, SearchViewFlags.CompactView | flags) { title = flags.ToString() }; SearchService.ShowWindow(viewArgs); } }
defaultSize | Determine the default search view size when it first opens. |
context | Search context used to populate the search view. |
excludeClearItem | Set to true to hide the None item when in picker mode. |
flags | Various search view options. |
group | Indicates the group or tab to be selected when the Search window opens. |
groupChanged | External handler used to be notified when the user changes the current group/tab. |
hasQueryPanel | Is the SearchViewState allows for the left side Query panel to be shown. |
hasWindowSize | Determines if the search view was opened with a predefined size. If false, then it means the search view was opened the previous window size it was last closed with. |
hideAllGroup | Determine if the All group/tab should be hidden. |
hideTabs | Indicates if the search tabs (group providers) should be hidden or shown. |
ignoreSaveSearches | If true, the search view will not load previous saved searches. |
isQueryPanelVisible | Is the Left side query panel shown? |
itemSize | Indicates the item size to be used when the Search window opens. |
position | If defined, indicates the location of the new Search window when it opens. |
queryBuilderEnabled | If true, the search view will be opened in builder mode. |
selectHandler | External handler triggered when the user has selected an item in picker mode. |
sessionId | Unique session ID generated by the system each time a search view is opened. |
tableConfig | Access the search table configuration used if in table view. |
text | Text used to initialize the search view. |
title | Indicates the search topic title. |
trackingHandler | External handler triggered each time the user clicks on an item in the search view. |
windowSize | Determine the size the search view was opened with. |
windowTitle | If defined, this title will be used to open a new search view and sets the EditorWindow.titleContent. |
SearchViewState | Create search view flags used to create a new Search window. |
GetProviderIds | Returns all the search provider ids in the current search context. |
GetProviderTypes | Returns all the search provider types in the current search context. |
HasFlag | Checks if the search view was defined with specific set of flags. |
ToString | Convert SearchViewState to a string. |
CreatePickerState | Create a SearchViewState specially setup to show an Object Picker. |
LoadDefaults | Returns a newly created default search view state. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.