public void Start(string targetPath, bool isRecursive, ResultCallback callback) { if (!IsInitialized) { return; } if (string.IsNullOrEmpty(targetPath)) { return; } if (targetPath.StartsWith("Packages/")) { return; } // var callbackTarget = callback.Target as UnityObject; // if (callbackTarget == null) // { // throw new Exception("callback.Target is not UnityObject"); // } lock (sync) { CancelImpl(); EnqueueProcess(targetPath, isRecursive, callback); StartWorker(); } AssetDependencyDatabase.SetScanPaused(true); AssetDependencyDatabase.EnqueueScanDependency(targetPath); }
public void FoundReference(ReferenceSearchEngineProcess process, string objectPath, string targetPath) { // var o = process.Callback.Target as UnityObject; // if (o == null) // { // return; // } if (objectPath.StartsWith(Root)) { objectPath = objectPath.Substring(objectPath.Length + 1); } process.Callback(objectPath); if (process.IsRecursive && !targetPath.StartsWith("ProjectSettings/")) { EnqueueProcess(objectPath, process.IsRecursive, process.Callback, process.Results); } if (process.Results.Count > 5) { AssetDependencyDatabase.SetScanPaused(false); } AssetDependencyDatabase.EnqueueScanDependency(objectPath); }