示例#1
0
        public static void Initialize()
        {
            if (s_IndexInitialized)
            {
                return;
            }

            if (s_GlobalIndexer.LoadIndexFromDisk(null, true))
            {
                s_IndexInitialized = true;
                AssetPostprocessorIndexer.Enable();
                AssetPostprocessorIndexer.contentRefreshed -= OnContentRefreshed;
                AssetPostprocessorIndexer.contentRefreshed += OnContentRefreshed;

                #if DEBUG_UBER_INDEXING
                Debug.Log("Search index loaded from disk");
                #endif
            }
            #if USE_UMPE_INDEXING
            else if (ProcessService.level == ProcessLevel.UMP_MASTER)
            {
                // Launch indexing bot.
                #if DEBUG_UBER_INDEXING
                Debug.Log("Launching quick search indexing bot...");
                #endif
                ProcessService.LaunchSlave(k_RoleName,
                                           "headless", "true",
                                           "disableManagedDebugger", "true",
                                           "ump-cap", "disable-extra-resources");
            }
            #else
            else
            {
                s_GlobalIndexer.reportProgress += ReportProgress;
                #if USE_ASYNC_PROGRESS_BAR
                Progress.RunTask(k_ProgressTitle, null, s_GlobalIndexer.BuildAsync, Progress.Options.Sticky, -1);
                #else
                s_GlobalIndexer.Build();
                #endif
            }
            #endif
        }
        public static void Initialize()
        {
            if (s_IndexInitialized)
            {
                return;
            }

            if (s_GlobalIndexer.LoadIndexFromDisk(null, true))
            {
                s_IndexInitialized = true;
                AssetPostprocessorIndexer.Enable();
                AssetPostprocessorIndexer.contentRefreshed -= OnContentRefreshed;
                AssetPostprocessorIndexer.contentRefreshed += OnContentRefreshed;

                #if DEBUG_UBER_INDEXING
                Debug.Log("Search index loaded from disk");
                #endif
            }
            else
            {
                s_GlobalIndexer.reportProgress += ReportProgress;
                s_GlobalIndexer.Build();
            }
        }