Version: Unity 6.2 (6000.2)
Language : English
Manage search queries
Create a custom search provider

Invoke from the main menu

To create a custom menu item that invokes a search, use the MenuItem attribute. The following example creates a menu item that searches the Asset StoreA growing library of free and commercial assets created by Unity and members of the community. Offers a wide variety of assets, from textures, models and animations to whole project examples, tutorials and Editor extensions. More info
See in Glossary
for free assets:

[MenuItem("Search/Free Asset Gifts")]
static void SearchStore()
{
    var storeContext = SearchService.CreateContext("store", "price=0");
    var viewState = new SearchViewState(storeContext,
        UnityEngine.Search.SearchViewFlags.DisableNoResultTips |
        UnityEngine.Search.SearchViewFlags.GridView);
    viewState.windowTitle = new GUIContent("Free Stuff for Christmas");
    viewState.queryBuilderEnabled = true;
    SearchService.ShowWindow(viewState);
}
Manage search queries
Create a custom search provider
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961