| searchText | 搜索查询。 | 
| provider | 搜索提供程序(此搜索提供程序不需要处于活动或注册状态)。 | 
| providerId | 唯一的搜索提供程序 ID 字符串(例如,资源、场景、查找等) | 
| providerIds | 搜索提供程序 ID 列表。 | 
| providers | 搜索提供程序列表。 | 
| flags | 定义如何执行查询的选项。 | 
SearchContext 返回一个新的 SearchContext。
根据搜索提供程序 ID 列表创建上下文。
using UnityEditor; using UnityEditor.Search; using UnityEngine; static class Example_SearchService_CreateContext { [MenuItem("Examples/SearchService/CreateContext")] public static void Run() { using var searchContext = SearchService.CreateContext("scene", "camera"); using var results = SearchService.Request(searchContext, SearchFlags.Synchronous); { foreach (var label in results.Select(r => r.GetLabel(searchContext))) Debug.Log(label); } } }