From 0f2937a67a3533378dc42f050c598721c5804f2f Mon Sep 17 00:00:00 2001 From: StarBeats <977663818@qq.com> Date: Wed, 22 Oct 2025 12:31:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=80=9F=E7=9B=AE=E5=BD=95=E9=81=8D?= =?UTF-8?q?=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UnityDependencyAnalyzer/Utils.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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; }