diff --git a/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs b/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs index 225580b041..eeb13a2706 100644 --- a/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs +++ b/Assets/Scripts/Editor/GameEditor/FrameTool/DeleteResWindow.cs @@ -83,24 +83,27 @@ namespace GameEditor.Util continue; } dic[keyValue.Key].Add(resPath); - if (ext.Contains("tga") || ext.Contains("jpg") || ext.Contains("png") || ext.Contains("mp3") || ext.Contains("wav")) - { } - else + if (dependDic.ContainsKey(resPath)) { - if(dependDic.ContainsKey(resPath)) + for (int j = 0; j < dependDic[resPath].Count; j++) { - for (int j = 0; j < dependDic[resPath].Count; j++) + if (!dependUnUsedDic.ContainsKey(dependDic[resPath][j])) { - if (!dependUnUsedDic.ContainsKey(dependDic[resPath][j])) - { - dependUnUsedDic[dependDic[resPath][j]] = new List(); - } - dependUnUsedDic[dependDic[resPath][j]].Add(dependDic[resPath][j]); + dependUnUsedDic[dependDic[resPath][j]] = new List(); } + dependUnUsedDic[dependDic[resPath][j]].Add(dependDic[resPath][j]); } } } } + //foreach (KeyValuePair> keyValue in dependUnUsedDic) + //{ + // Debug.Log("-------------------------------------------------------"); + // for (int i = 0; i < keyValue.Value.Count; i++) + // { + // Debug.Log("keyValue.Value[i]:" + keyValue.Value[i]); + // } + //} } static void FindUnUsedDepend() @@ -115,21 +118,32 @@ namespace GameEditor.Util FindUnUsedDependByPath(keyValue.Value[i]); } } + //foreach (KeyValuePair> keyValue in dic) + //{ + // Debug.Log("-------------------------------------------------------"); + // for (int i = 0; i < keyValue.Value.Count; i++) + // { + // Debug.Log("keyValue.Value[i]:" + keyValue.Value[i]); + // } + //} } static void FindUnUsedDependByPath(string resPath) { + //Debug.Log("-------------------------------------------------------"); if (refrenceDic.ContainsKey(resPath)) { bool isDelete = true; for (int i = 0; i < refrenceDic[resPath].Count; i++) { + //Debug.Log(" refrenceDic[resPath]:"+ refrenceDic[resPath][i]); if (!dependUnUsedDic.ContainsKey(refrenceDic[resPath][i])) { isDelete = false; break; } } + //Debug.Log("isDelete:" + isDelete); if (!dic.ContainsKey(resPath)) dic[resPath] = new List(); if (isDelete)