Просмотр исходного кода

导入动画前清除冗余文件

zhaoyang 3 лет назад
Родитель
Сommit
ed33d3ffb2

+ 4 - 0
GameClient/Assets/Editor/ArtsRes/ImportArtResTool.cs

@@ -110,6 +110,10 @@ namespace GFGEditor
             EditorUtility.DisplayProgressBar("进度", "正在导入卡牌图标", 1);
             ImportRes(CardIconSrcPaths, CardIconTargetPath, CardMd5FileSaveName);
 
+            //清除冗余动画
+            FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.DressUpAnimationTargetPath, ImportArtResTool.DressUpAnimationSrcPaths[0]);
+            FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.EffectTargetPath, ImportArtResTool.EffectSrcPaths[0]);
+
             //动画
             EditorUtility.DisplayProgressBar("进度", "正在导入动作动画", 1);
             ImportFileAndDir(DressUpAnimationSrcPaths, DressUpAnimationTargetPath, new string[] { ".moc3" });

+ 3 - 3
GameClient/Assets/Editor/FileUtil.cs

@@ -351,17 +351,17 @@ namespace GFGEditor
                 foreach (var lfile in localFiles)
                 {
                     var lfileName = Path.GetFileName(lfile);
-                    bool needDelete = false;
+                    bool existFile = false;
                     foreach (var sfile in souFiles)
                     {
                         var sfileName = Path.GetFileName(sfile);
                         if (lfileName == sfileName)
                         {
-                            needDelete = true;
+                            existFile = true;
                             break;
                         }
                     }
-                    if (!needDelete)
+                    if (!existFile)
                     {
                         File.Delete(lfile);
                     }

+ 1 - 2
GameClient/Assets/Editor/ToolsMenu.cs

@@ -197,13 +197,12 @@ namespace GFGEditor
             FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.TextureTargetPath, ImportArtResTool.TextureSrcPaths[0]);
         }
 
-        [MenuItem("策划/其它/清除冗余动画")]
+        // [MenuItem("策划/其它/清除冗余动画")]
         public static void DeleteUnnecessaryAni()
         {
             EditorUtility.DisplayProgressBar("进度", "正在清除冗余动画", 1);
             FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.DressUpAnimationTargetPath, ImportArtResTool.DressUpAnimationSrcPaths[0]);
             FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.EffectTargetPath, ImportArtResTool.EffectSrcPaths[0]);
-            FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.MaterialTargetPath, ImportArtResTool.MaterialSrcPaths[0]);
             EditorUtility.ClearProgressBar();
 
             // FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.TextureTargetPath, ImportArtResTool.TextureSrcPaths[0]);