资源删除工具修改提交
parent
b98fd71d35
commit
0d16b1511a
|
@ -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<string>();
|
||||
if (!dependUnUsedDic.ContainsKey(dependDic[resPath][j]))
|
||||
{
|
||||
dependUnUsedDic[dependDic[resPath][j]] = new List<string>();
|
||||
}
|
||||
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<string, List<string>> 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<string>();
|
||||
if (isDelete)
|
||||
{
|
||||
dic[resName].Add(resPath);
|
||||
dic[resPath].Add(resPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue