Browse Source

资源工具

zhaoyang 3 years ago
parent
commit
80b0e21ec7

+ 10 - 8
GameClient/Assets/Editor/ArtsRes/ImportArtResTool.cs

@@ -15,7 +15,7 @@ namespace GFGEditor
         public static string ResRootPathDressUp { get { return $"../../../gfg/{ResRootDirNameDressUp}/"; } }
 
         public static string ragule = @"^[0-9a-zA-Z_]{1,}$";
-        public static string Md5FilePath = "Assets/MD5";
+        public static string Md5FilePath = "Assets/Res/MD5";
 
         private static string[] FieldGuideIconSrcPaths { get { return new string[] { ResRootPath + "图鉴/" }; } }
         public static string FieldGuideIconTargetPath = $"{ResPathUtil.TEXTURE_DIR_PATH}/FieldGuide/Icon/";
@@ -73,13 +73,14 @@ namespace GFGEditor
         public static string[] EffectSrcPaths { get { return new string[] { ResRootPath + $"ArtProject/{ResPathUtil.EFFECT_DIR_PATH}/" }; } }
         public static string EffectTargetPath = $"{ResPathUtil.EFFECT_DIR_PATH}/";
 
-        public static string[] MaterialSrcPaths { get { return new string[] { ResRootPath + $"ArtProject/{ResPathUtil.Material_DIR_PATH}/" }; } }
-        public static string MaterialTargetPath = $"{ResPathUtil.Material_DIR_PATH}/";
-
-        public static string[] TextureSrcPaths { get { return new string[] { ResRootPath + $"ArtProject/{ResPathUtil.Texture_DIR_PATH}/" }; } }
-        public static string TextureTargetPath = $"{ResPathUtil.Texture_DIR_PATH}/";
+        public static string[] MaterialSrcPaths { get { return new string[] { ResRootPath + $"ArtProject/{ResPathUtil.Material_DIR_PATH}/Effect/" }; } }
+        public static string MaterialTargetPath = $"{ResPathUtil.Material_DIR_PATH}/Effect/";
+        public static string EffectMaterialMd5FileSaveName = "EffectMaterialMd5";
 
 
+        public static string[] TextureSrcPaths { get { return new string[] { ResRootPath + $"ArtProject/{ResPathUtil.Texture_DIR_PATH}/Effect/" }; } }
+        public static string TextureTargetPath = $"{ResPathUtil.Texture_DIR_PATH}/Effect/";
+        public static string EffectTextureMd5FileSaveName = "EffectTextureMd5";
 
         public static void Import()
         {
@@ -122,10 +123,11 @@ namespace GFGEditor
             ImportFileAndDir(EffectSrcPaths, EffectTargetPath);
             //材质
             EditorUtility.DisplayProgressBar("进度", "正在导入特效材质", 1);
-            ImportFileAndDir(MaterialSrcPaths, MaterialTargetPath);
+            ImportRes(MaterialSrcPaths, MaterialTargetPath, EffectMaterialMd5FileSaveName);
+
             //图片
             EditorUtility.DisplayProgressBar("进度", "正在导入特效图片", 1);
-            ImportFileAndDir(TextureSrcPaths, TextureTargetPath);
+            ImportRes(TextureSrcPaths, TextureTargetPath, EffectTextureMd5FileSaveName);
 
             //NPC对话立绘
             EditorUtility.DisplayProgressBar("进度", "正在导入NPC对话立绘", 1);

+ 2 - 6
GameClient/Assets/Editor/FileUtil.cs

@@ -247,13 +247,9 @@ namespace GFGEditor
             if (targetPath == ImportArtResTool.DressUpTargetPath)
             {
                 DeleteUnnecessaryImagePos(ImportArtResTool.DressUpTargetPath);
-                DeleteUnnecessaryImageMD5(ImportArtResTool.DressUpMd5FileSaveName);
+                // DeleteUnnecessaryImageMD5(ImportArtResTool.DressUpMd5FileSaveName);
             }
-            // if (targetPath == ImportArtsRes.DressUpAnimationTargetPath || targetPath == ImportArtsRes.EffectTargetPath)
-            // {
-            //     DeleteUnnecessaryAnimation(ImportArtsRes.DressUpAnimationTargetPath, ImportArtsRes.DressUpAnimationSrcPaths[0]);
-            //     Debug.Log("动画清除完成");
-            // }
+            Debug.Log(targetPath + "清除完成");
         }
 
         //清除无资源的Md5数据

+ 6 - 7
GameClient/Assets/Editor/ToolsMenu.cs

@@ -179,7 +179,7 @@ namespace GFGEditor
 
             FileUtil.DeleteUnnecessaryImage(ImportArtResTool.MusicTargetPath, ImportArtResTool.MusicMd5FileSaveName);
 
-            FileUtil.DeleteUnnecessaryImage(ImportArtResTool.ItemIconTargetPath, ImportArtResTool.IconMd5FileSaveName);
+            // FileUtil.DeleteUnnecessaryImage(ImportArtResTool.ItemIconTargetPath, ImportArtResTool.IconMd5FileSaveName);
 
             FileUtil.DeleteUnnecessaryImage(ImportArtResTool.NpcHeadTargetPath, ImportArtResTool.HeadMd5FileSaveName);
 
@@ -189,12 +189,11 @@ namespace GFGEditor
 
             FileUtil.DeleteUnnecessaryImage(ImportArtResTool.CardIconTargetPath, ImportArtResTool.CardMd5FileSaveName);
 
-            // FileUtil.DeleteUnnecessaryImage(ImportArtsRes.DressUpAnimationTargetPath);
-            // FileUtil.DeleteUnnecessaryImage(ImportArtsRes.EffectTargetPath);
-            FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.DressUpAnimationTargetPath, ImportArtResTool.DressUpAnimationSrcPaths[0]);
-            FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.EffectTargetPath, ImportArtResTool.EffectSrcPaths[0]);
-            FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.MaterialTargetPath, ImportArtResTool.MaterialSrcPaths[0]);
-            FileUtil.DeleteUnnecessaryAnimation(ImportArtResTool.TextureTargetPath, ImportArtResTool.TextureSrcPaths[0]);
+            FileUtil.DeleteUnnecessaryImage(ImportArtResTool.MaterialTargetPath, ImportArtResTool.EffectMaterialMd5FileSaveName);
+
+            FileUtil.DeleteUnnecessaryImage(ImportArtResTool.TextureTargetPath, ImportArtResTool.EffectTextureMd5FileSaveName);
+
+            DeleteUnnecessaryAni();
         }
 
         // [MenuItem("策划/其它/清除冗余动画")]