|
@@ -2,6 +2,7 @@
|
|
|
using System.Collections.Generic;
|
|
|
using System.IO;
|
|
|
using GFGEditor;
|
|
|
+using GFGGame;
|
|
|
using UnityEditor;
|
|
|
using UnityEngine;
|
|
|
|
|
@@ -77,16 +78,112 @@ namespace VEngine.Editor.Builds
|
|
|
|
|
|
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)
|
|
|
+ {
|
|
|
+ if (suitCfg.isHide <= 0)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ HideSuitActionRes(suitCfg, hideFilePathList, hideDirPahtList);
|
|
|
+ }
|
|
|
+ //卡牌资源打包屏蔽
|
|
|
+ //var cardCfgs = ItemCfgArray.Instance.GetCfgsByitemType(ConstItemType.CARD);
|
|
|
+ //foreach (var itemCfg in cardCfgs)
|
|
|
+ //{
|
|
|
+ // if (itemCfg.isHide <= 0)
|
|
|
+ // {
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+ // HideCardRes(itemCfg, hideFilePathList, hideDirPahtList);
|
|
|
+ //}
|
|
|
+
|
|
|
foreach (var resRootDirName in resRootDirNames)
|
|
|
{
|
|
|
- CreateBundles(resRootDirName, setName);
|
|
|
+ CreateBundles(resRootDirName, setName, hideFilePathList, hideDirPahtList);
|
|
|
}
|
|
|
CheckAssets();
|
|
|
EditorUtility.ClearProgressBar();
|
|
|
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)
|
|
|
+ {
|
|
|
+ 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 buildSetting = GFGEditor.BuildSetting.GetBuildSetting(setName);
|
|
@@ -101,6 +198,10 @@ namespace VEngine.Editor.Builds
|
|
|
file = file.Replace('\\', '/');
|
|
|
string curDir = Environment.CurrentDirectory.Replace("\\", "/");
|
|
|
string filePath = file.Replace(curDir + "/", "");
|
|
|
+ if(hideFilePathList.Contains(filePath))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
EditorUtility.DisplayProgressBar("采集资源", filePath, 1f);
|
|
|
var bundle = filePath.Replace($"Assets/{resRootDirName}/", "");
|
|
|
|
|
@@ -140,12 +241,15 @@ namespace VEngine.Editor.Builds
|
|
|
var targetDirPath = subDirPath.Replace('\\', '/');
|
|
|
string curDirPath = Environment.CurrentDirectory.Replace("\\", "/");
|
|
|
string subDir = targetDirPath.Replace(curDirPath + "/", "");
|
|
|
+ if(hideDirPahtList.Contains(subDir))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
var bundle = subDir.Replace($"Assets/{resRootDirName}/", "");
|
|
|
bundle = bundle.Replace('/', '_');
|
|
|
bundle = bundle.ToLower();
|
|
|
GFGEditor.FileUtil.ForeachFileInDir(subDirPath, null, (string file) =>
|
|
|
{
|
|
|
- var ext = Path.GetExtension(file);
|
|
|
file = file.Replace('\\', '/');
|
|
|
string curDir = Environment.CurrentDirectory.Replace("\\", "/");
|
|
|
string filePath = file.Replace(curDir + "/", "");
|