如果索引已准备就绪可用于搜索,则返回 bool 值。
会指示索引是否已完全建立、是最新的并已准备好进行搜索。
using System.Linq; using UnityEditor; using UnityEditor.Search; using UnityEngine; static class Example_SearchIndexer_IsReady { [MenuItem("Examples/SearchIndexer/IsReady")] public static void Run() { // Create an indexer and wait for indexing to complete in the current thread. var si = new SearchIndexer(); si.Start(); si.AddDocument("document 1"); si.AddDocument("document 2"); si.Finish(); while (!si.IsReady()) ; Debug.Log("Indexing is completed"); } }