internal static void SearchAssetStoreMenu() { SearchAnalytics.SendEvent(null, SearchAnalytics.GenericEventType.QuickSearchOpen, "SearchAssetStore"); var storeContext = SearchService.CreateContext(SearchService.GetProvider(k_ProviderId)); var qs = QuickSearch.Create(storeContext, topic: "asset store"); qs.itemIconSize = (int)DisplayMode.Grid; qs.SetSearchText(string.Empty); qs.ShowWindow(); }
internal static void SearchAssetStoreMenu() { SearchAnalytics.SendEvent(null, SearchAnalytics.GenericEventType.QuickSearchOpen, "SearchAssetStore"); var storeContext = SearchService.CreateContext(SearchService.GetProvider(k_ProviderId)); var qs = QuickSearch.Create(storeContext, topic: "asset store", saveFilters: false, multiselect: false); qs.itemIconSize = 128; qs.SetSearchText(String.Empty); qs.ShowWindow(); }
/// <summary> /// Creates and open a new instance of Quick Search /// </summary> /// <param name="context">Initial search context of QuickSearch</param> /// <param name="topic">QuickSearch search topic</param> /// <param name="defaultWidth">Initial width of the window.</param> /// <param name="defaultHeight">Initial height of the window.</param> /// <param name="multiselect">True if the search support multi-selection or not.</param> /// <param name="dockable">If true, creates a dockable QuickSearch Window (that will be closed when an item is activated). If false, it will create a DropDown (borderless, undockable and unmovable) version of QuickSearch.</param> /// <param name="saveFilters">True if user provider filters should be saved for next search session</param> /// <param name="reuseExisting">If true, try to reuse an already existing instance of QuickSearch. If false will create a new QuickSearch window.</param> /// <returns>Returns the Quick Search editor window instance.</returns> public static ISearchView ShowWindow(SearchContext context = null, string topic = "Unity", float defaultWidth = 850, float defaultHeight = 539, bool saveFilters = true, bool reuseExisting = false, bool multiselect = true, bool dockable = true) { var flags = SearchFlags.None; if (saveFilters) { flags |= SearchFlags.SaveFilters; } if (reuseExisting) { flags |= SearchFlags.ReuseExistingWindow; } if (multiselect) { flags |= SearchFlags.Multiselect; } if (dockable) { flags |= SearchFlags.Dockable; } return(QuickSearch.Create <QuickSearch>(context, topic, flags).ShowWindow(defaultWidth, defaultHeight, flags)); }
/// <summary> /// Show a search window. /// </summary> /// <param name="viewState">Defines search view parameters for creation</param> /// <returns></returns> public static ISearchView ShowWindow(SearchViewState viewState) { return(QuickSearch.Create(viewState).ShowWindow()); }
/// <summary> /// Show a search window. /// </summary> /// <param name="viewState">Defines search view parameters for creation</param> /// <returns></returns> public static ISearchView ShowWindow(SearchViewState viewState) { return(QuickSearch.Create(viewState).ShowWindow(viewState.windowSize.x, viewState.windowSize.y, SearchFlags.OpenDefault | (viewState.context?.options ?? SearchFlags.None))); }