context | Search context to start with. |
selectHandler | Callback invoked when an item is selected. |
trackingHandler | Callback invoked when an item is clicked without it being the final selection. |
filterHandler | Callback invoked to filter search item results to display. |
title | Topic to search. |
itemSize | Initial result view item size. |
defaultWidth | Initial width of the window. |
defaultHeight | Initial height of the window. |
subset | Initial set of items to be searched. |
flags | Options defining how the query is performed. |
ISearchView Creates a new search window.
Open a search item picker window.
viewState | Search view state used to open the Search Picker window. |
ISearchView Creates a new search window.
Open a Search Picker window.
This example shows how to open a custom search picker to pick a decal material.
var selectHandler = args.selectorClosedHandler; var trackingHandler = args.trackingHandler; var query = SearchService.CreateContext(CreateDecalProvider(), $"a={dbName} t={selectContext.requiredTypeNames.First()} shader=Decal"); var viewState = new SearchViewState(query, CreateDecalsTableConfiguration(), SearchViewFlags.TableView | SearchViewFlags.OpenInBuilderMode | SearchViewFlags.DisableSavedSearchQuery); viewState.windowTitle = new GUIContent("Material Decals", GetMaterialIcon()); viewState.hideAllGroup = true; viewState.title = "decals"; viewState.selectHandler = (item, canceled) => selectHandler(item?.ToObject(), canceled); viewState.trackingHandler = (item) => trackingHandler(item?.ToObject()); viewState.position = SearchUtils.GetMainWindowCenteredPosition(new Vector2(600, 400)); SearchService.ShowPicker(viewState);