private void MakeCic(ChapterInfoCustom cic) { for (int i = 0; i < cic.needStar.get_Count(); i++) { int key = BoxRewardManager.Instance.MakeBoxRewardID(cic.chapterID, cic.type, cic.needStar.get_Item(i)); if (BoxRewardManager.Instance.m_mapChapterAwards.ContainsKey(key)) { ChapterAwardInfo chapterAwardInfo = BoxRewardManager.Instance.m_mapChapterAwards[key]; if (chapterAwardInfo.canReceive && !chapterAwardInfo.isReceived) { cic.canGetReward = true; break; } cic.canGetReward = false; } } for (int j = 0; j < cic.needStar.get_Count(); j++) { int key2 = BoxRewardManager.Instance.MakeBoxRewardID(cic.chapterID, cic.type, cic.needStar.get_Item(j)); if (BoxRewardManager.Instance.m_mapChapterAwards.ContainsKey(key2)) { ChapterAwardInfo chapterAwardInfo2 = BoxRewardManager.Instance.m_mapChapterAwards[key2]; if (chapterAwardInfo2.canReceive && !chapterAwardInfo2.isReceived) { cic.starCondition = cic.needStar.get_Item(j); break; } if (!chapterAwardInfo2.canReceive) { cic.starCondition = cic.needStar.get_Item(j); break; } if (chapterAwardInfo2.canReceive && chapterAwardInfo2.isReceived) { if (j == cic.needStar.get_Count() - 1) { cic.starCondition = cic.needStar.get_Item(j); } } } } }
public bool CheckEliteDungeonBadge() { for (int i = 0; i < DungeonManager.Instance.EliteData.get_Count(); i++) { int chapterId = DungeonManager.Instance.EliteData.get_Item(i).chapterId; ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .Get(chapterId); for (int j = 0; j < zhuXianZhangJiePeiZhi.needStar.get_Count(); j++) { int key = this.MakeBoxRewardID(zhuXianZhangJiePeiZhi.id, 102, zhuXianZhangJiePeiZhi.needStar.get_Item(j)); if (this.m_mapChapterAwards.ContainsKey(key)) { ChapterAwardInfo chapterAwardInfo = BoxRewardManager.Instance.m_mapChapterAwards[key]; if (chapterAwardInfo.canReceive && !chapterAwardInfo.isReceived) { return(true); } } } } return(false); }
protected void DebugInfo() { for (int i = 0; i < this.m_mapChapterAwards.Values.get_Count(); i++) { ChapterAwardInfo chapterAwardInfo = this.m_mapChapterAwards.Values.get_Item(i); XDict <string, int> xDict = this.ParseAwardId(chapterAwardInfo.chapterAwardId); Debug.LogError(string.Concat(new object[] { "cai.canReceive ", chapterAwardInfo.canReceive, " cai.chapterAwardId ", chapterAwardInfo.chapterAwardId, " cai.isReceived ", chapterAwardInfo.isReceived, " dic chapter ", xDict["chapter"], " dic type ", xDict["type"], " dic needstar ", xDict["needstar"] })); } }
private void RefreshBoxReward(int chapter, DungeonType.ENUM dungeonType) { if (dungeonType == DungeonType.ENUM.Normal || dungeonType == DungeonType.ENUM.Elite) { this.Reward.get_gameObject().SetActive(true); ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .DataList.Find((ZhuXianZhangJiePeiZhi a) => a.chapterOrder == chapter && a.chapterType == (int)dungeonType); if (zhuXianZhangJiePeiZhi != null) { for (int i = 0; i < zhuXianZhangJiePeiZhi.needStar.get_Count(); i++) { int needstar = zhuXianZhangJiePeiZhi.needStar.get_Item(i); int key = BoxRewardManager.Instance.MakeBoxRewardID(zhuXianZhangJiePeiZhi.id, (int)dungeonType, needstar); if (BoxRewardManager.Instance.m_mapChapterAwards.ContainsKey(key)) { ChapterAwardInfo chapterAwardInfo = BoxRewardManager.Instance.m_mapChapterAwards[key]; if (chapterAwardInfo.canReceive && !chapterAwardInfo.isReceived) { this.currentChapterAwardInfo = chapterAwardInfo; break; } if (!chapterAwardInfo.canReceive) { this.currentChapterAwardInfo = chapterAwardInfo; break; } } else { Debug.LogError("cai == null"); } } ChapterInfoCustom chapterInfoCustom = null; if (dungeonType == DungeonType.ENUM.Normal) { chapterInfoCustom = this.dicChaptersNormal.get_Item(chapter); } else if (dungeonType == DungeonType.ENUM.Elite) { chapterInfoCustom = this.dicChaptersElite.get_Item(chapter); } ChapterInfo chapterInfo = this.listData.get_Item(chapter - 1); if (chapterInfoCustom.canGetReward) { this.BtnBoxReward.get_transform().FindChild("Image1").get_gameObject().SetActive(true); this.BtnBoxReward.get_transform().FindChild("Image2").get_gameObject().SetActive(false); if (this.fxBoxReward != 0) { FXSpineManager.Instance.DeleteSpine(this.fxBoxReward, true); } this.fxBoxReward = FXSpineManager.Instance.PlaySpine(1601, this.BtnBoxReward.get_transform().FindChild("FX"), "InstanceSelectUI", 2001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None); } else if (!chapterInfoCustom.canGetReward && chapterInfo.totalStar == chapterInfoCustom.needStar.get_Item(chapterInfoCustom.needStar.get_Count() - 1)) { this.BtnBoxReward.get_transform().FindChild("Image1").get_gameObject().SetActive(false); this.BtnBoxReward.get_transform().FindChild("Image2").get_gameObject().SetActive(true); if (this.fxBoxReward != 0) { FXSpineManager.Instance.DeleteSpine(this.fxBoxReward, true); } } else { this.BtnBoxReward.get_transform().FindChild("Image1").get_gameObject().SetActive(true); this.BtnBoxReward.get_transform().FindChild("Image2").get_gameObject().SetActive(false); if (this.fxBoxReward != 0) { FXSpineManager.Instance.DeleteSpine(this.fxBoxReward, true); } } this.currentRewardNeedStar = chapterInfoCustom.starCondition; this.TextRewardNow.set_text(string.Concat(new object[] { string.Empty, chapterInfo.totalStar, "/", chapterInfoCustom.starCondition })); } } else { this.Reward.get_gameObject().SetActive(false); } }