diff --git a/UnityDependencyAnalyzer/Utils.cs b/UnityDependencyAnalyzer/Utils.cs index fded6de..8484360 100644 --- a/UnityDependencyAnalyzer/Utils.cs +++ b/UnityDependencyAnalyzer/Utils.cs @@ -25,9 +25,27 @@ namespace AssetDependencyGraph } } + public static void TraverseDirectoryParallel(string path, Action action) + { + Parallel.ForEach(Directory.EnumerateFileSystemEntries(path, "*", SearchOption.AllDirectories), action); + } + public static void TraverseDirectory(string path, Action action, int depth = 1) { - if(depth == 0) + //if (depth == -1) + //{ + // //foreach (string file in Directory.EnumerateFiles(path, "*.*", SearchOption.AllDirectories)) + // //{ + // // action.Invoke(file); + // //} + + // //foreach (string directory in Directory.EnumerateDirectories(path, "*.*", SearchOption.AllDirectories)) + // //{ + // // action.Invoke(directory); + // //} + //} + + if (depth == 0) { return; }