|
@@ -127,15 +127,28 @@ namespace GFGGame
|
|
|
RedDotController.Instance.SetComRedDot(item.target, redVisible, "", posRedX, posRedY);
|
|
|
|
|
|
if (activityStoryCfg.needItemsArr.Length > 0) {
|
|
|
- if (ItemDataManager.ItemCollect[activityStoryCfg.needItemsArr[0][0]] < activityStoryCfg.needItemsArr[0][1])
|
|
|
+ int count;
|
|
|
+ if (ItemDataManager.ItemCollect.TryGetValue(activityStoryCfg.needItemsArr[0][0], out count))
|
|
|
+ {
|
|
|
+ if (count < activityStoryCfg.needItemsArr[0][1])
|
|
|
+ {
|
|
|
+ item.m_openCloseType.selectedIndex = 0;
|
|
|
+ item.m_txtNotOpenTitle.text = string.Format("收集{0}/{1}个", ItemDataManager.ItemCollect[activityStoryCfg.needItemsArr[0][0]], activityStoryCfg.needItemsArr[0][1]);
|
|
|
+ ItemCfg itemNeedCfg = ItemCfgArray.Instance.GetCfg(activityStoryCfg.needItemsArr[0][0]);
|
|
|
+ item.m_loaNeedIcon.url = ResPathUtil.GetIconPath(itemNeedCfg);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ item.m_openCloseType.selectedIndex = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
item.m_openCloseType.selectedIndex = 0;
|
|
|
- item.m_txtNotOpenTitle.text = string.Format("收集{0}/{1}个", ItemDataManager.ItemCollect[activityStoryCfg.needItemsArr[0][0]], activityStoryCfg.needItemsArr[0][1]);
|
|
|
+ item.m_txtNotOpenTitle.text = string.Format("收集{0}/{1}个", 0, activityStoryCfg.needItemsArr[0][1]);
|
|
|
ItemCfg itemNeedCfg = ItemCfgArray.Instance.GetCfg(activityStoryCfg.needItemsArr[0][0]);
|
|
|
item.m_loaNeedIcon.url = ResPathUtil.GetIconPath(itemNeedCfg);
|
|
|
}
|
|
|
- else
|
|
|
- item.m_openCloseType.selectedIndex = 1;
|
|
|
}
|
|
|
|
|
|
if (item.m_loaItemBg.data == null)
|
|
@@ -163,10 +176,22 @@ namespace GFGGame
|
|
|
PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
|
|
|
return;
|
|
|
}
|
|
|
- if(index > 0 && ItemDataManager.ItemCollect[activityStoryCfg.needItemsArr[0][0]] < activityStoryCfg.needItemsArr[0][1])
|
|
|
+ if (index > 0)
|
|
|
{
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("需收集物达到开启需求");
|
|
|
- return;
|
|
|
+ int count;
|
|
|
+ if (ItemDataManager.ItemCollect.TryGetValue(activityStoryCfg.needItemsArr[0][0], out count))
|
|
|
+ {
|
|
|
+ if (count < activityStoryCfg.needItemsArr[0][1])
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("需收集物达到开启需求");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("需收集物达到开启需求");
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
MainStoryDataManager.currentLevelCfgId = storyLevelCfg.id;
|