From 0d16b1511a959ae8aa839b4e285df13c71269c7f Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Wed, 28 Jul 2021 17:26:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=A0=E9=99=A4=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameEditor/FrameTool/DeleteResWindow.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs b/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs index c32841ab3a..225580b041 100644 --- a/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs +++ b/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs @@ -40,7 +40,7 @@ namespace GameEditor.Util } static void InitData() { - FileStream fs = new FileStream(tag + "/deleteFile1.csv", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); + FileStream fs = new FileStream(tag + "/deleteFile.csv", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); StreamReader sr = new StreamReader(fs, System.Text.Encoding.UTF8); string str = ""; int index = 0; @@ -89,11 +89,14 @@ namespace GameEditor.Util { if(dependDic.ContainsKey(resPath)) { - if (!dependUnUsedDic.ContainsKey(keyValue.Key)) + for (int j = 0; j < dependDic[resPath].Count; j++) { - dependUnUsedDic[keyValue.Key] = new List(); + if (!dependUnUsedDic.ContainsKey(dependDic[resPath][j])) + { + dependUnUsedDic[dependDic[resPath][j]] = new List(); + } + dependUnUsedDic[dependDic[resPath][j]].Add(dependDic[resPath][j]); } - dependUnUsedDic[keyValue.Key].AddRange(dependDic[resPath]); } } } @@ -105,7 +108,6 @@ namespace GameEditor.Util int num = 0; foreach (KeyValuePair> keyValue in dependUnUsedDic) { - resName = keyValue.Key; num = num + 1; EditorUtility.DisplayProgressBar("寻找依赖资源", resName, num*1.0f/ dependUnUsedDic.Count); for (int i = 0; i < keyValue.Value.Count;i++ ) @@ -128,9 +130,11 @@ namespace GameEditor.Util break; } } + if (!dic.ContainsKey(resPath)) + dic[resPath] = new List(); if (isDelete) { - dic[resName].Add(resPath); + dic[resPath].Add(resPath); } } }