From 31378d1a7640f91a8b44b386dc96b3bd8fae7740 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 13 Nov 2020 11:30:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B7=A5=E5=85=B7=E3=80=91=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E8=B5=84=E6=BA=90=E8=B7=AF=E5=BE=84=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E8=87=AA=E5=8A=A8=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ResourcesPath/ResourcesPathEditor.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Assets/Scripts/Editor/GameEditor/ResourcesPath/ResourcesPathEditor.cs b/Assets/Scripts/Editor/GameEditor/ResourcesPath/ResourcesPathEditor.cs index e48435e530..96269c6377 100644 --- a/Assets/Scripts/Editor/GameEditor/ResourcesPath/ResourcesPathEditor.cs +++ b/Assets/Scripts/Editor/GameEditor/ResourcesPath/ResourcesPathEditor.cs @@ -264,22 +264,22 @@ namespace GameEditor if (resPaths.ContainsKey (fileName)) { var info = resPaths[fileName]; string oldPath = string.Format("{0}/{1}{2}", dirPaths[info.resPathIndex], info.resName, info.extension); - Debug.LogErrorFormat("资源名重复:{0}=>{1}", path, oldPath); - string exName = Path.GetExtension(path).Replace(".", ""); - if (!string.IsNullOrEmpty(exName)) //给资源文件加后缀名规避重复 - { - if (exName != "prefab")//避免给prefab文件更名 - { - string newPath = AssetDatabase.RenameAsset(path, Path.GetFileNameWithoutExtension(path) + "_" + exName); - Debug.LogErrorFormat("资源名已修正:{0} 请再次刷新文件路径", path); - } - else - { - string newPath = AssetDatabase.RenameAsset(oldPath, Path.GetFileNameWithoutExtension(oldPath) - + "_" + Path.GetExtension(oldPath).Replace(".", "")); - Debug.LogErrorFormat("资源名已修正:{0} 请再次刷新文件路径", oldPath); - } - } + Debug.LogErrorFormat("资源名重复:{0}\n原有资源:{2}\n重复资源:{1}", info.resName, path, oldPath); + //string exName = Path.GetExtension(path).Replace(".", ""); + //if (!string.IsNullOrEmpty(exName)) //给资源文件加后缀名规避重复 + //{ + // if (exName != "prefab")//避免给prefab文件更名 + // { + // string newPath = AssetDatabase.RenameAsset(path, Path.GetFileNameWithoutExtension(path) + "_" + exName); + // Debug.LogErrorFormat("资源名已修正:{0} 请再次刷新文件路径", path); + // } + // else + // { + // string newPath = AssetDatabase.RenameAsset(oldPath, Path.GetFileNameWithoutExtension(oldPath) + // + "_" + Path.GetExtension(oldPath).Replace(".", "")); + // Debug.LogErrorFormat("资源名已修正:{0} 请再次刷新文件路径", oldPath); + // } + //} } else {