|
@@ -1,4 +1,5 @@
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
using ET;
|
|
|
using UnityEngine;
|
|
|
|
|
@@ -8,11 +9,14 @@ namespace GFGGame
|
|
|
{
|
|
|
private static Dictionary<int, ItemData> _dataDic = new Dictionary<int, ItemData>();
|
|
|
private static Dictionary<int, int> _itemExchangeDic = new Dictionary<int, int>();
|
|
|
+
|
|
|
delegate object MemberGetDelegate(ItemCfg p);
|
|
|
+
|
|
|
public static void Clear()
|
|
|
{
|
|
|
_itemExchangeDic.Clear();
|
|
|
}
|
|
|
+
|
|
|
public static void Add(int itemID, long itemNum)
|
|
|
{
|
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
|
|
@@ -27,8 +31,7 @@ namespace GFGGame
|
|
|
itemData = _dataDic[itemID];
|
|
|
if (itemCfg.itemType == ConstItemType.CARD)
|
|
|
{
|
|
|
- return;//每张卡牌只有一张
|
|
|
-
|
|
|
+ return; //每张卡牌只有一张
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -51,13 +54,14 @@ namespace GFGGame
|
|
|
|
|
|
if (dataInited
|
|
|
&& itemCfg.rarity == ConstDressRarity.Rarity_TIANYI
|
|
|
- && StorageDataManager.Instance.GetStorageValue(ConstStorageId.FUNCTION_OPEN + functionOpenCfg.index) == 0)
|
|
|
+ && StorageDataManager.Instance.GetStorageValue(ConstStorageId.FUNCTION_OPEN +
|
|
|
+ functionOpenCfg.index) == 0)
|
|
|
{
|
|
|
-
|
|
|
FunctionOpenDataManager.Instance.CheckHasSpecialFunOpen();
|
|
|
}
|
|
|
}
|
|
|
- if ((itemCfg.itemType == ConstItemType.ITEM || itemCfg.itemType == ConstItemType.GIFT_BAG) && itemData.num > 0)
|
|
|
+ if ((itemCfg.itemType == ConstItemType.ITEM || itemCfg.itemType == ConstItemType.GIFT_BAG) &&
|
|
|
+ itemData.num > 0)
|
|
|
{
|
|
|
BagDataManager.Instance.Add(itemData);
|
|
|
}
|
|
@@ -102,7 +106,8 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (itemCfg.itemType == ConstItemType.DRESS_UP && !DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemID))
|
|
|
+ if (itemCfg.itemType == ConstItemType.DRESS_UP &&
|
|
|
+ !DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemID))
|
|
|
{
|
|
|
DecomposeDataManager.Instance.Remove(itemID);
|
|
|
}
|
|
@@ -149,6 +154,7 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
public static void InitItemExchange(int itemId, int exchangTimes)
|
|
|
{
|
|
|
if (_itemExchangeDic.ContainsKey(itemId))
|
|
@@ -160,6 +166,7 @@ namespace GFGGame
|
|
|
_itemExchangeDic.Add(itemId, exchangTimes);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//获取物品已兑换次数
|
|
|
public static int GetItemExchangeTimes(int itemId)
|
|
|
{
|
|
@@ -226,6 +233,7 @@ namespace GFGGame
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 获取一个换装部件对应的标签分数
|
|
|
/// </summary>
|
|
@@ -250,10 +258,10 @@ namespace GFGGame
|
|
|
score += int.Parse(itemCfg.tagsArr[i][1]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
return score;
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 检测一件服装是否包含要求的标签
|
|
|
/// </summary>
|