|
@@ -4,6 +4,7 @@ using System.IO;
|
|
using UnityEngine.Rendering;
|
|
using UnityEngine.Rendering;
|
|
using YooAsset;
|
|
using YooAsset;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
+using System;
|
|
|
|
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
@@ -228,13 +229,12 @@ namespace GFGGame
|
|
|
|
|
|
private static DressUpLayerOperation UpdateLayerResAsync(ItemCfg itemCfg, GameObject parentObj, int layerId, bool needSetMask, bool showAni = true)
|
|
private static DressUpLayerOperation UpdateLayerResAsync(ItemCfg itemCfg, GameObject parentObj, int layerId, bool needSetMask, bool showAni = true)
|
|
{
|
|
{
|
|
- string res = ResPathUtil.GetDressUpItemLayerRes(itemCfg, layerId);
|
|
|
|
string resPath;
|
|
string resPath;
|
|
string aniResPath = null;
|
|
string aniResPath = null;
|
|
//根据资源存在与否再次检查是否播放动画
|
|
//根据资源存在与否再次检查是否播放动画
|
|
if (showAni)
|
|
if (showAni)
|
|
{
|
|
{
|
|
- aniResPath = ResPathUtil.GetDressUpAnimationPath(res);
|
|
|
|
|
|
+ aniResPath = ResPathUtil.GetDressUpLayerAnimationResPath(itemCfg, layerId);
|
|
if(!YooAssets.CheckResExist(aniResPath))
|
|
if(!YooAssets.CheckResExist(aniResPath))
|
|
{
|
|
{
|
|
showAni = false;
|
|
showAni = false;
|
|
@@ -247,7 +247,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- resPath = ResPathUtil.GetDressUpPath(itemCfg, layerId);
|
|
|
|
|
|
+ resPath = ResPathUtil.GetDressUpLayerSpriteResPath(itemCfg, layerId);
|
|
}
|
|
}
|
|
|
|
|
|
if (!YooAssets.CheckResExist(resPath))
|
|
if (!YooAssets.CheckResExist(resPath))
|
|
@@ -256,7 +256,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
|
|
|
|
//特效
|
|
//特效
|
|
- string effectResPath = ResPathUtil.GetDressUpEffectPath(res, showAni);
|
|
|
|
|
|
+ string effectResPath = ResPathUtil.GetDressUpLayerEffectResPath(itemCfg, layerId);
|
|
if (!YooAssets.CheckResExist(effectResPath))
|
|
if (!YooAssets.CheckResExist(effectResPath))
|
|
{
|
|
{
|
|
effectResPath = null;
|
|
effectResPath = null;
|
|
@@ -499,7 +499,41 @@ namespace GFGGame
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ public static List<int> GetSuitItems(int suitId, bool isAction, int[] excludeType = null, bool showOptional = true, bool CheckOwn = true)
|
|
|
|
+ {
|
|
|
|
+ SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
|
|
|
|
+ if (suitCfg == null)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ List<int> items = new List<int>(suitCfg.partsArr);
|
|
|
|
+ if (showOptional)
|
|
|
|
+ {
|
|
|
|
+ if (suitCfg.partsOptionalArr != null && suitCfg.partsOptionalArr.Length > 0)
|
|
|
|
+ {
|
|
|
|
+ items.AddRange(suitCfg.partsOptionalArr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ int subType = 0;
|
|
|
|
+ //找到要穿的散件
|
|
|
|
+ List<int> targetItemList = new List<int>();
|
|
|
|
+ foreach (int itemId in items)
|
|
|
|
+ {
|
|
|
|
+ if (!CheckOwn || DressUpMenuItemDataManager.CheckHasItem(itemId))
|
|
|
|
+ {
|
|
|
|
+ subType = ItemUtilCS.GetItemSubType(itemId);
|
|
|
|
+ bool notInAction = SuitCfgArray.Instance.CheckItemNotInAction(itemId);
|
|
|
|
+ if (!isAction || notInAction)
|
|
|
|
+ {
|
|
|
|
+ if (excludeType == null || Array.IndexOf(excludeType, subType) < 0)
|
|
|
|
+ {
|
|
|
|
+ targetItemList.Add(itemId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return targetItemList;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|