Forráskód Böngészése

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

# Conflicts:
#	GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes
zhaoyang 2 éve
szülő
commit
867041c298

+ 45 - 0
GameClient/Assets/Editor/ArtsRes/DeleteFileHelper.cs

@@ -0,0 +1,45 @@
+using System.Collections.Generic;
+using UnityEngine;
+using GFGGame;
+using System.IO;
+using System.Text;
+using UnityEditor;
+
+namespace GFGEditor
+{
+    public class DeleteFileHelper
+    {
+        private static List<string> DeleteList = new List<string>();
+
+        public static void AddFile(string path)
+        {
+            DeleteList.Add(path);
+        }
+
+        public static void TrySvnRemoveDeleteFile()
+        {
+            var stringBuilder = new StringBuilder();
+            Debug.Log("CommitDelteFile");
+            foreach (var deleteFile in DeleteList)
+            {
+                if(File.Exists(deleteFile))
+                {
+                    continue;
+                }
+                string deleteFile1 = deleteFile.Replace($"{ResPathUtil.RES_ROOT_DIR_PATH}/", "");
+                Debug.Log($"deleteFile1 {deleteFile1}");
+                stringBuilder.AppendLine($"svn rm {deleteFile1}");
+                stringBuilder.AppendLine($"svn rm {deleteFile1}.meta");
+            }
+            //stringBuilder.AppendLine("pause");
+
+            var batFileName = "removeFiles.bat";
+            var batDirPath = ResPathUtil.RES_ROOT_DIR_PATH + "/";
+            var batFile = batDirPath + batFileName;
+            File.WriteAllText(batFile, stringBuilder.ToString());
+            AssetDatabase.Refresh();
+            ProcessUtil.ExcuteBat(batDirPath, batFileName);
+            DeleteList.Clear();
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Editor/ArtsRes/DeleteFileHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 75286febcf975a7469a9005d3a62142f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 17 - 5
GameClient/Assets/Editor/FileUtil.cs → GameClient/Assets/Editor/ArtsRes/FileUtil.cs

@@ -253,7 +253,7 @@ namespace GFGEditor
         }
 
         //清除无资源的Md5数据
-        public static void DeleteUnnecessaryImageMD5(string[] saveNames)
+        private static void DeleteUnnecessaryImageMD5(string[] saveNames)
         {
             for (int j = 0; j < saveNames.Length; j++)
             {
@@ -276,7 +276,7 @@ namespace GFGEditor
                 ImagesClip.WriteSourceImagesMD5(sourceResMD5, saveName);
             }
         }
-        public static void DeleteUnnecessaryImageRes(string targetPath, string[] saveNames)
+        private static void DeleteUnnecessaryImageRes(string targetPath, string[] saveNames)
         {
             string[] includeExtensionNames = new string[] { ".png", ".jpg" };
             if (!Directory.Exists(targetPath))
@@ -318,12 +318,19 @@ namespace GFGEditor
                     }
 
                 }
-                if (!has) File.Delete(targetPath + fileName);
+                if (!has)
+                {
+                    var deleteFile = targetPath + fileName;
+                    File.Delete(targetPath + fileName);
+
+                    //写入删除文件脚本
+                    DeleteFileHelper.AddFile(deleteFile);
+                }
             }
             Debug.Log(targetPath + "清除完成!");
         }
         //清除冗余位置文件
-        public static void DeleteUnnecessaryImagePos(string targetPath)
+        private static void DeleteUnnecessaryImagePos(string targetPath)
         {
             string[] includeExtensionNames = new string[] { ".png", ".jpg" };
             var files = Directory.GetFiles(targetPath);
@@ -339,8 +346,11 @@ namespace GFGEditor
                 string targetFilePath = targetPath + fileName;
                 if (extensionName == ".bytes" && !File.Exists(targetFilePath + includeExtensionNames[0]) && !File.Exists(targetFilePath + includeExtensionNames[1]))
                 {
-                    File.Delete(targetPath + Path.GetFileName(file));
+                    var deleteFile = targetPath + Path.GetFileName(file);
+                    File.Delete(deleteFile);
 
+                    //写入删除文件脚本
+                    DeleteFileHelper.AddFile(deleteFile);
                 }
             }
 
@@ -371,6 +381,8 @@ namespace GFGEditor
                     if (!existFile)
                     {
                         File.Delete(lfile);
+                        //写入删除文件脚本
+                        DeleteFileHelper.AddFile(lfile);
                     }
                 }
                 foreach (var lDir in localDirs)

+ 0 - 0
GameClient/Assets/Editor/FileUtil.cs.meta → GameClient/Assets/Editor/ArtsRes/FileUtil.cs.meta


+ 1 - 1
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/Res/MD5";
+        public static string Md5FilePath = $"{ResPathUtil.RES_ROOT_DIR_PATH}/MD5";
 
         private static string[] FieldGuideIconSrcPaths { get { return new string[] { ResRootPath + "图鉴/" }; } }
         public static string FieldGuideIconTargetPath = $"{ResPathUtil.TEXTURE_DIR_PATH}/FieldGuide/Icon/";

+ 0 - 2
GameClient/Assets/Editor/Bat/updateArtRes.bat

@@ -1,5 +1,3 @@
 echo %1
 cd ../../../../../../gfg/%1
 svn up --force --accept tc
-
-pause

+ 1 - 4
GameClient/Assets/Editor/Bat/updateGame.bat

@@ -1,7 +1,4 @@
-cd ../../../Assets/Res
-svn up --force --accept tc
-
-cd ../../../
+cd ../../../../
 git clean -df
 git reset --hard
 git status

+ 2 - 0
GameClient/Assets/Editor/Bat/updateGameRes.bat

@@ -0,0 +1,2 @@
+cd ../../../Assets/Res
+svn up --force --accept tc

+ 7 - 0
GameClient/Assets/Editor/Bat/updateGameRes.bat.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 12c58c93f9b3883429c64694e499eee1
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -66,6 +66,7 @@ namespace GFGEditor
         [MenuItem("策划/更新并导入美术资源", false, (int)TOOL_MENU_PRIORITY.UpdateAndImportArtRes)]
         static void UpdateAndImportArtResAndCommit()
         {
+            UpdateProjectRes();
             UpdateAndImportArtRes();
             if (CommitWhenRelease)
             {
@@ -94,6 +95,7 @@ namespace GFGEditor
             Thread.Sleep(1000);
             EditorUtility.DisplayProgressBar("进度", "正在更新项目", 1);
             ProcessUtil.ExcuteBat("Assets/Editor/Bat/", "updateGame.bat");
+            UpdateProjectRes();
             EditorUtility.ClearProgressBar();
         }
 
@@ -125,6 +127,11 @@ namespace GFGEditor
         }
 #endif
 
+        private static void UpdateProjectRes()
+        {
+            ProcessUtil.ExcuteBat("Assets/Editor/Bat/", "updateGameRes.bat");
+        }
+
         public static void UpdateExcel()
         {
             EditorUtility.DisplayProgressBar("进度", "正在更新表格", 1);
@@ -147,6 +154,7 @@ namespace GFGEditor
         static void CommitProject()
         {
             EditorUtility.DisplayProgressBar("进度", "正在提交项目", 1);
+            DeleteFileHelper.TrySvnRemoveDeleteFile();
             ProcessUtil.ExcuteBat("Assets/Editor/Bat/", "commitGame.bat");
             EditorUtility.ClearProgressBar();
         }
@@ -278,8 +286,8 @@ namespace GFGEditor
 
             FileUtil.DeleteUnnecessaryImage(ImportArtResTool.TextureTargetPath, new string[] { ImportArtResTool.EffectTextureMd5FileSaveName });
 
+            DeleteFileHelper.TrySvnRemoveDeleteFile();
             EditorUtility.ClearProgressBar();
-
         }
 
         [MenuItem("Tools/List Player Assemblies in Console")]

+ 1 - 1
GameClient/Assets/Editor/Xasset/Builds/BuildTask.cs

@@ -9,7 +9,7 @@ namespace VEngine.Editor.Builds
 {
     public class BuildTask
     {
-        private readonly string[] EXCLUDE_EXTS = new string[] { ".meta" };
+        private readonly string[] EXCLUDE_EXTS = new string[] { ".meta", ".bat" };
         private readonly string[] EXCLUDE_DIRS = new string[] { "Assets/Res/.svn", ImportArtResTool.Md5FilePath };
         private readonly BuildAssetBundleOptions buildAssetBundleOptions;
         private readonly List<Asset> bundledAssets = new List<Asset>();

+ 17 - 13
GameClient/Assets/Game/HotUpdate/Utils/ResPathUtil.cs

@@ -5,20 +5,24 @@ namespace GFGGame
         public const string RESIN_TXT_DIR_PATH = "Assets/ResIn/Txt";
 
         public const string FONT_DIR_PATH = "Assets/ResIn/Font";
-        public const string MUSIC_DIR_PATH = "Assets/Res/Music";
-        public const string SOUND_DIR_PATH = "Assets/Res/Sound";
-        public const string UI_DIR_PATH = "Assets/ResIn/UI";
-        public const string TEXTURE_DIR_PATH = "Assets/Res/Texture";
-        public const string PREFAB_DIR_PATH = "Assets/ResIn/Prefab";
-        public const string TEXTURE_FIGHT_DIR_PATH = "Assets/ResIn/Fight";
-        public const string CONFIG_DIR_PATH = "Assets/ResIn/Config";
-        public const string ANIMATION_DIR_PATH = "Assets/Res/Animation";
-        public const string EFFECT_DIR_PATH = "Assets/Res/Effect";
-        public const string Material_DIR_PATH = "Assets/Res/Material";
-        public const string Shader_DIR_PATH = "Assets/Res/Shader";
-        public const string Texture_DIR_PATH = "Assets/Res/Texture";
+        public static readonly string UI_DIR_PATH = "Assets/ResIn/UI";
+        public static readonly string PREFAB_DIR_PATH = "Assets/ResIn/Prefab";
+        public static readonly string TEXTURE_FIGHT_DIR_PATH = "Assets/ResIn/Fight";
+        public static readonly string CONFIG_DIR_PATH = "Assets/ResIn/Config";
 
-        public const string SQLITE_FILE_PATH = CONFIG_DIR_PATH + "/" + LauncherConfig.SQL_FILE_NAME;
+
+        public const string RES_ROOT_DIR_PATH = "Assets/Res";
+
+        public static readonly string MUSIC_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Music";
+        public static readonly string SOUND_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Sound";
+        public static readonly string TEXTURE_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Texture";
+        public static readonly string ANIMATION_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Animation";
+        public static readonly string EFFECT_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Effect";
+        public static readonly string Material_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Material";
+        public static readonly string Shader_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Shader";
+        public static readonly string Texture_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Texture";
+
+        public  static readonly string SQLITE_FILE_PATH = CONFIG_DIR_PATH + "/" + LauncherConfig.SQL_FILE_NAME;
 
         public static string GetUIPackagePath(string res)
         {

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes