コード例 #1
0
    private static void Load(string indexPath)
    {
        var sw = new System.Diagnostics.Stopwatch();

        sw.Start();

        var indexBytes = File.ReadAllBytes(indexPath);

        index = new SearchIndexer();
        index.LoadBytes(indexBytes, (success) =>
        {
            if (!success)
            {
                Debug.LogError($"Failed to load dependency index at {indexPath}");
            }
            else
            {
                Debug.Log($"Loading dependency index took {sw.Elapsed.TotalMilliseconds,3:0.##} ms ({EditorUtility.FormatBytes(indexBytes.Length)} bytes)");
            }
        });
    }