guodong 2 жил өмнө
parent
commit
b36bd45901

+ 2 - 1
GameClient/Assets/BuildSetting.asset

@@ -16,6 +16,7 @@ MonoBehaviour:
   - Assets/Res/Animation/Card
   - Assets/Res/Animation/Card
   - Assets/Res/Animation/DressUp
   - Assets/Res/Animation/DressUp
   - Assets/Res/Effect/DressUp
   - Assets/Res/Effect/DressUp
+  - Assets/Res/Effect/DressUpAni
   - Assets/Res/Effect/UI
   - Assets/Res/Effect/UI
   - Assets/ResIn/UI
   - Assets/ResIn/UI
   - Assets/ResIn/Dll
   - Assets/ResIn/Dll
@@ -26,4 +27,4 @@ MonoBehaviour:
   - texture_dressup_ts_
   - texture_dressup_ts_
   - texture_dressup_xz_
   - texture_dressup_xz_
   - texture_dressup_zr_
   - texture_dressup_zr_
-  - prefab
+  - prefab_

+ 1 - 0
GameClient/Assets/BuildSetting1.asset

@@ -16,6 +16,7 @@ MonoBehaviour:
   - Assets/Res/Animation/Card
   - Assets/Res/Animation/Card
   - Assets/Res/Animation/DressUp
   - Assets/Res/Animation/DressUp
   - Assets/Res/Effect/DressUp
   - Assets/Res/Effect/DressUp
+  - Assets/Res/Effect/DressUpAni
   - Assets/Res/Effect/UI
   - Assets/Res/Effect/UI
   - Assets/ResIn/UI
   - Assets/ResIn/UI
   - Assets/ResIn/Dll
   - Assets/ResIn/Dll

+ 103 - 3
GameClient/Assets/Editor/Xasset/Builds/BuildTask.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
 using GFGEditor;
 using GFGEditor;
+using GFGGame;
 using UnityEditor;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine;
 
 
@@ -77,16 +78,108 @@ namespace VEngine.Editor.Builds
 
 
         public void BuildCustomBundles(string[] resRootDirNames, string setName)
         public void BuildCustomBundles(string[] resRootDirNames, string setName)
         {
         {
+            List<string> hideFilePathList = new List<string>();
+            List<string> hideDirPahtList = new List<string>();
+            //换装资源打包屏蔽
+            SqliteController.Instance.dirPath = Path.Combine(Environment.CurrentDirectory, ResPathUtil.CONFIG_DIR_PATH);
+            SqliteController.Instance.Init(false, null);
+            var dressUpItemList = ItemCfgArray.Instance.GetCfgsByitemType(ConstItemType.DRESS_UP);
+            foreach (var itemCfg in dressUpItemList)
+            {
+                if (itemCfg.isHide <= 0)
+                {
+                    continue;
+                }
+                if (!string.IsNullOrEmpty(itemCfg.resLayer1))
+                {
+                    HideItemRes(itemCfg, 1, hideFilePathList, hideDirPahtList);
+                }
+                if (!string.IsNullOrEmpty(itemCfg.resLayer2))
+                {
+                    HideItemRes(itemCfg, 2, hideFilePathList, hideDirPahtList);
+                }
+                if (!string.IsNullOrEmpty(itemCfg.resLayer3))
+                {
+                    HideItemRes(itemCfg, 3, hideFilePathList, hideDirPahtList);
+                }
+            }
+            //套装动作资源打包屏蔽
+            var suitCfgs = SuitCfgArray.Instance.dataArray;
+            foreach(var suitCfg in suitCfgs)
+            {
+                HideSuitActionRes(suitCfg, hideFilePathList, hideDirPahtList);
+            }
+            //卡牌资源打包屏蔽
+            //var cardCfgs = ItemCfgArray.Instance.GetCfgsByitemType(ConstItemType.CARD);
+            //foreach(var itemCfg in cardCfgs)
+            //{
+            //    HideCardRes(itemCfg, hideFilePathList, hideDirPahtList);
+            //}
+
             foreach (var resRootDirName in resRootDirNames)
             foreach (var resRootDirName in resRootDirNames)
             {
             {
-                CreateBundles(resRootDirName, setName);
+                CreateBundles(resRootDirName, setName, hideFilePathList, hideDirPahtList);
             }
             }
             CheckAssets();
             CheckAssets();
             EditorUtility.ClearProgressBar();
             EditorUtility.ClearProgressBar();
             FinishBuild();
             FinishBuild();
         }
         }
 
 
-        private void CreateBundles(string resRootDirName, string setName)
+        private void HideItemRes(ItemCfg itemCfg, int layerId, List<string> hideFilePathList, List<string> hideDirPahtList)
+        {
+            string res = DressUpUtil.GetDressUpItemLayerRes(itemCfg, layerId);
+            //部件图
+            var resPath = ResPathUtil.GetDressUpPath(res, ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType));
+            hideFilePathList.Add(resPath);
+            //动画
+            resPath = ResPathUtil.GetDressUpAnimationDirPath(res);
+            hideDirPahtList.Add(resPath);
+            //特效
+            resPath = ResPathUtil.GetDressUpEffectDirPath(res);
+            hideDirPahtList.Add(resPath);
+            resPath = ResPathUtil.GetDressUpEffectDirPath(res, true);
+            hideDirPahtList.Add(resPath);
+        }
+
+        private void HideSuitActionRes(SuitCfg suitCfg, List<string> hideFilePathList, List<string> hideDirPahtList)
+        {
+            if(suitCfg.isHide <= 0)
+            {
+                return;
+            }
+            string resPath;
+            //动画
+            if(!string.IsNullOrEmpty(suitCfg.aniRes))
+            {
+                resPath = ResPathUtil.GetDressUpAnimationDirPath(suitCfg.aniRes);
+                hideDirPahtList.Add(resPath);
+            }
+            //特效
+            if (!string.IsNullOrEmpty(suitCfg.effRes))
+            {
+                resPath = ResPathUtil.GetDressUpEffectDirPath(suitCfg.effRes);
+                hideDirPahtList.Add(resPath);
+                resPath = ResPathUtil.GetDressUpEffectDirPath(suitCfg.effRes, true);
+                hideDirPahtList.Add(resPath);
+            }
+        }
+
+        //private void HideCardRes(ItemCfg itemCfg, List<string> hideFilePathList, List<string> hideDirPahtList)
+        //{
+        //    //大图
+        //    var resPath = ResPathUtil.GetCardPath(itemCfg.res);
+        //    hideFilePathList.Add(resPath); 
+        //    //小图
+        //    resPath = ResPathUtil.GetCardSmallPath(itemCfg.res);
+        //    hideFilePathList.Add(resPath);
+        //    //动画
+        //    resPath = ResPathUtil.GetCardAnimationDirPath(itemCfg.res);
+        //    hideDirPahtList.Add(resPath);
+        //    //特效
+        //    //to do...暂时没有
+        //}
+
+        private void CreateBundles(string resRootDirName, string setName, List<string> hideFilePathList, List<string> hideDirPahtList)
         {
         {
             var path = Path.Combine(Application.dataPath, resRootDirName);
             var path = Path.Combine(Application.dataPath, resRootDirName);
             var buildSetting = GFGEditor.BuildSetting.GetBuildSetting(setName);
             var buildSetting = GFGEditor.BuildSetting.GetBuildSetting(setName);
@@ -101,6 +194,10 @@ namespace VEngine.Editor.Builds
                     file = file.Replace('\\', '/');
                     file = file.Replace('\\', '/');
                     string curDir = Environment.CurrentDirectory.Replace("\\", "/");
                     string curDir = Environment.CurrentDirectory.Replace("\\", "/");
                     string filePath = file.Replace(curDir + "/", "");
                     string filePath = file.Replace(curDir + "/", "");
+                    if(hideFilePathList.Contains(filePath))
+                    {
+                        return;
+                    }
                     EditorUtility.DisplayProgressBar("采集资源", filePath, 1f);
                     EditorUtility.DisplayProgressBar("采集资源", filePath, 1f);
                     var bundle = filePath.Replace($"Assets/{resRootDirName}/", "");
                     var bundle = filePath.Replace($"Assets/{resRootDirName}/", "");
 
 
@@ -140,12 +237,15 @@ namespace VEngine.Editor.Builds
                     var targetDirPath = subDirPath.Replace('\\', '/');
                     var targetDirPath = subDirPath.Replace('\\', '/');
                     string curDirPath = Environment.CurrentDirectory.Replace("\\", "/");
                     string curDirPath = Environment.CurrentDirectory.Replace("\\", "/");
                     string subDir = targetDirPath.Replace(curDirPath + "/", "");
                     string subDir = targetDirPath.Replace(curDirPath + "/", "");
+                    if(hideDirPahtList.Contains(subDir))
+                    {
+                        return;
+                    }
                     var bundle = subDir.Replace($"Assets/{resRootDirName}/", "");
                     var bundle = subDir.Replace($"Assets/{resRootDirName}/", "");
                     bundle = bundle.Replace('/', '_');
                     bundle = bundle.Replace('/', '_');
                     bundle = bundle.ToLower();
                     bundle = bundle.ToLower();
                     GFGEditor.FileUtil.ForeachFileInDir(subDirPath, null, (string file) =>
                     GFGEditor.FileUtil.ForeachFileInDir(subDirPath, null, (string file) =>
                     {
                     {
-                        var ext = Path.GetExtension(file);
                         file = file.Replace('\\', '/');
                         file = file.Replace('\\', '/');
                         string curDir = Environment.CurrentDirectory.Replace("\\", "/");
                         string curDir = Environment.CurrentDirectory.Replace("\\", "/");
                         string filePath = file.Replace(curDir + "/", "");
                         string filePath = file.Replace(curDir + "/", "");

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Data/FriendDataManager.cs

@@ -28,7 +28,8 @@ namespace GFGGame
         {
         {
             get
             get
             {
             {
-                return GlobalCfgArray.globalCfg.maxGetPowerCount + GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.MonthCardFriendPowerAdd);
+                var t = GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.MonthCardFriendPowerAdd);
+                return GlobalCfgArray.globalCfg.maxGetPowerCount + t * GlobalCfgArray.globalCfg.onceGivePowerCount;
             }
             }
         }
         }
 
 

+ 19 - 7
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -206,27 +206,39 @@ namespace GFGGame
             assetDisposer.resPath = resPath;
             assetDisposer.resPath = resPath;
         }
         }
 
 
-        private static void updateLayerRes(ItemCfg itemCfg, GameObject parentObj, int layerId, bool needSetMask, bool showAni = true)
+        public static string GetDressUpItemLayerRes(ItemCfg itemCfg, int layerId)
         {
         {
-
-            ItemTypeCfg typeCfg = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType);
-
             string res = itemCfg.res;
             string res = itemCfg.res;
-            int sortingOrder = typeCfg.defaultLayer;
             switch (layerId)
             switch (layerId)
             {
             {
                 case 1:
                 case 1:
                     res = itemCfg.resLayer1 == "n" ? res : string.Format("{0}_{1}", res, itemCfg.resLayer1);
                     res = itemCfg.resLayer1 == "n" ? res : string.Format("{0}_{1}", res, itemCfg.resLayer1);
                     break;
                     break;
                 case 2:
                 case 2:
-                    sortingOrder = typeCfg.specialLayer;
                     res = itemCfg.resLayer2 == "n" ? res : string.Format("{0}_{1}", res, itemCfg.resLayer2);
                     res = itemCfg.resLayer2 == "n" ? res : string.Format("{0}_{1}", res, itemCfg.resLayer2);
                     break;
                     break;
                 case 3:
                 case 3:
-                    sortingOrder = typeCfg.thirdlLayer;
                     res = itemCfg.resLayer3 == "n" ? res : string.Format("{0}_{1}", res, itemCfg.resLayer3);
                     res = itemCfg.resLayer3 == "n" ? res : string.Format("{0}_{1}", res, itemCfg.resLayer3);
                     break;
                     break;
             }
             }
+            return res;
+        }
+
+        private static void updateLayerRes(ItemCfg itemCfg, GameObject parentObj, int layerId, bool needSetMask, bool showAni = true)
+        {
+
+            ItemTypeCfg typeCfg = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType);
+
+            string res = GetDressUpItemLayerRes(itemCfg, layerId);
+            int sortingOrder = typeCfg.defaultLayer;
+            if(layerId == 2)
+            {
+                sortingOrder = typeCfg.specialLayer;
+            }
+            else if(layerId == 3)
+            {
+                sortingOrder = typeCfg.thirdlLayer;
+            }
 
 
             //清理旧的
             //清理旧的
             var spritObjName = string.Format(FORMAT_SPRITE_NAME, itemCfg.subType, layerId);
             var spritObjName = string.Format(FORMAT_SPRITE_NAME, itemCfg.subType, layerId);

+ 20 - 6
GameClient/Assets/Game/HotUpdate/Utils/ResPathUtil.cs

@@ -106,9 +106,14 @@ namespace GFGGame
         {
         {
             return $"{PREFAB_DIR_PATH}/{res}.{extName}";
             return $"{PREFAB_DIR_PATH}/{res}.{extName}";
         }
         }
+        public static string GetDressUpAnimationDirPath(string res)
+        {
+            return $"{ANIMATION_DIR_PATH}/DressUp/{res}";
+        }
+
         public static string GetDressUpAnimationPath(string res, string extName = "prefab")
         public static string GetDressUpAnimationPath(string res, string extName = "prefab")
         {
         {
-            return $"{ANIMATION_DIR_PATH}/DressUp/{res}/{res}.{extName}";
+            return $"{GetDressUpAnimationDirPath(res)}/{res}.{extName}";
         }
         }
 
 
         public static bool CheckDressUpAnimationExist(string res, string extName = "prefab")
         public static bool CheckDressUpAnimationExist(string res, string extName = "prefab")
@@ -121,21 +126,30 @@ namespace GFGGame
             return VEngine.Versions.Contains(resPath);
             return VEngine.Versions.Contains(resPath);
         }
         }
 
 
-        public static string GetDressUpEffectPath(string res, bool inAni = false, string extName = "prefab")
+        public static string GetDressUpEffectDirPath(string res, bool inAni = false)
         {
         {
-            if(inAni)
+            if (inAni)
             {
             {
-                return $"{EFFECT_DIR_PATH}/DressUpAni/{res}/{res}.{extName}";
+                return $"{EFFECT_DIR_PATH}/DressUpAni/{res}";
             }
             }
-            return $"{EFFECT_DIR_PATH}/DressUp/{res}/{res}.{extName}";
+            return $"{EFFECT_DIR_PATH}/DressUp/{res}";
+        }
+
+        public static string GetDressUpEffectPath(string res, bool inAni = false, string extName = "prefab")
+        {
+            return $"{GetDressUpEffectDirPath(res, inAni)}/{res}.{extName}";
         }
         }
         public static string GetViewEffectPath(string uiName, string resName, string extName = "prefab")
         public static string GetViewEffectPath(string uiName, string resName, string extName = "prefab")
         {
         {
             return $"{EFFECT_DIR_PATH}/UI/{uiName}/{resName}.{extName}";
             return $"{EFFECT_DIR_PATH}/UI/{uiName}/{resName}.{extName}";
         }
         }
+        public static string GetCardAnimationDirPath(string res)
+        {
+            return $"{ANIMATION_DIR_PATH}/Card/{res}";
+        }
         public static string GetCardAnimationPath(string res, string extName = "prefab")
         public static string GetCardAnimationPath(string res, string extName = "prefab")
         {
         {
-            return $"{ANIMATION_DIR_PATH}/Card/{res}/{res}.{extName}";
+            return $"{GetCardAnimationDirPath(res)}/{res}.{extName}";
         }
         }
         public static string GetActivityPath(string res, string extName = "jpg")
         public static string GetActivityPath(string res, string extName = "jpg")
         {
         {