Unity 6.3
0 онлайн 0 гостей 3 в системе
Вход

SearchIndexer.IsReady

Declaration

public bool IsReady();

Возвращаемое значение

логическое Возвращает true, если индекс готов для поиска.

Описание

Показывает, полностью ли создан индекс, обновлен ли он и готов ли для поиска.

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.
        using var si = new SearchIndexer("SearchIndexerExample", FileUtil.GetUniqueTempPathInProject());
        si.Start();
        si.AddDocument("document 1");
        si.AddDocument("document 2");
        si.Finish();
        while (!si.IsReady())
            ;
        Debug.Log("Indexing is completed");
    }
}