/// <summary> /// 判断累计奖励宝箱的状态 /// </summary> /// <param name="boxIndex"></param> /// <returns></returns> bool IsMonthBoxOpen(int boxIndex) { bool res = false; boxIndex += 1; PlayerData.DaySignInInfoData DataSignInInfo = GameManager.gameManager.PlayerDataPool.DaySignInfo; if (DataSignInInfo != null && DataSignInInfo.m_AccumateSignDic != null) { if (DataSignInInfo.m_AccumateSignDic.ContainsKey(boxIndex)) { AccumulateSignInfo info = DataSignInInfo.m_AccumateSignDic[boxIndex]; if (info.ItemStatus == 0) { return(false); } else { return(true); } } } return(res); }
void OnClickBox() { if (m_bIsOpend) { return; } if (AwardLogic.Instance() != null) { PlayerData.DaySignInInfoData DataSignInInfo = GameManager.gameManager.PlayerDataPool.DaySignInfo; if (DataSignInInfo != null && DataSignInInfo.m_AccumateSignDic != null) { if (DataSignInInfo.m_AccumateSignDic.ContainsKey(m_Index + 1)) { AccumulateSignInfo info = DataSignInInfo.m_AccumateSignDic[m_Index + 1]; AwardLogic.Instance().m_AccSignPopUpBox.UpdateChestRewards(info, m_Index + 1, this); } } //if (OnClickBoxWithIndex != null) //{ // OnClickBoxWithIndex(m_Index); //} } }
public void InitAllItems() { m_AwardItem.Clear(); int begin = m_grid.transform.childCount; int end = GameManager.gameManager.PlayerDataPool.DaySignInfo.m_DaySignInfoList.Count; if (ItemObj != null && m_grid != null) { for (int m = begin; m < end; ++m) { GameObject go = GameObject.Instantiate(ItemObj) as GameObject; if (go != null) { go.transform.parent = m_grid.transform; go.transform.localScale = Vector3.one; } } m_grid.repositionNow = true; } for (int i = 0; i < m_grid.transform.childCount; i++) { Transform t = m_grid.transform.GetChild(i); if (t != null) { if (t.GetComponent <RewardAwardItem>() != null) { m_AwardItem.Add(t.GetComponent <RewardAwardItem>()); t.name = i.ToString(); t.gameObject.SetActive(false); } } } PlayerData.DaySignInInfoData DataSignInInfo = GameManager.gameManager.PlayerDataPool.DaySignInfo; DataSignInInfoList = DataSignInInfo.m_DaySignInfoList; NAlreadySignedCount = DataSignInInfo.m_nAlreadSignedCount; //UpdateMonthSlider(); // int curDay = DataSignInInfo.m_nowDayIndex; if (DataSignInInfoList.Count == 0) { return; } //ButtonRewardTipsDetail.text = StrDictionary.GetClientDictionaryString ("#{4639}"); CurMounthIndex.text = StrDictionary.GetClientDictionaryString("#{4640}", GameManager.gameManager.PlayerDataPool.CurMounthId); // int totalCounts = GameManager.gameManager.PlayerDataPool.GetTotalSignedCountThisMounth (); //AllSignedCountsMounth.text = StrDictionary.GetClientDictionaryString("#{4641}",totalCounts,GameManager.gameManager.PlayerDataPool.NowDayIndex); // int itemsCount = DataSignInInfoList.Count; DaySignInItem item; int count = 0; foreach (var itemPair in DataSignInInfoList) { if (count >= m_AwardItem.Count) { continue; } item = itemPair.Value; m_AwardItem[count].CleanUp(); if (item.Exp > 0) { m_AwardItem[count].AddItem(RewardAwardItem.ItemType.ITEM_EXP, -1, item.Exp, item.ItemIndex, item.ItemStatus, item.vipLimit, this, false); } if (item.Money > 0) { m_AwardItem[count].AddItem(RewardAwardItem.ItemType.ITEM_MONEY, -1, item.Money, item.ItemIndex, item.ItemStatus, item.vipLimit, this, false); } if (item.BindYuanbao > 0) { m_AwardItem[count].AddItem(RewardAwardItem.ItemType.ITEM_YUANBAO, -1, item.BindYuanbao, item.ItemIndex, item.ItemStatus, item.vipLimit, this, false); } // 物品 int nItem1DataID = item.Item1DataID; int nItem1Count = item.Item1Count; if (nItem1DataID >= 0 && nItem1Count > 0) { m_AwardItem[count].AddItem(RewardAwardItem.ItemType.ITEM_ITEM, nItem1DataID, nItem1Count, item.ItemIndex, item.ItemStatus, item.vipLimit, this, false); } int nItem2DataID = item.Item2DataID; int nItem2Count = item.Item2count; if (nItem2DataID >= 0 && nItem2Count > 0) { m_AwardItem[count].AddItem(RewardAwardItem.ItemType.ITEM_ITEM, nItem2DataID, nItem2Count, item.ItemIndex, item.ItemStatus, item.vipLimit, this, false); } m_AwardItem[count].gameObject.SetActive(true); count++; } // 默认显示服务器给定的可领元素 m_currentSelectedIndex = GameManager.gameManager.PlayerDataPool.CurSelectedDayIndex; if (m_currentSelectedIndex >= 1 && m_currentSelectedIndex <= m_AwardItem.Count) { m_AwardItem [m_currentSelectedIndex - 1].SetChooseState(true); DaySignInItem Signitem; DataSignInInfoList.TryGetValue(m_currentSelectedIndex, out Signitem); currentSelectedItem = Signitem; } int nowdayindex = GameManager.gameManager.PlayerDataPool.NowDayIndex; if (nowdayindex >= 1 && nowdayindex <= m_AwardItem.Count && DataSignInInfoList.ContainsKey(nowdayindex) && DataSignInInfoList[nowdayindex].ItemStatus == (int)DaySignInStates.NOTSIGNEN) { m_AwardItem[GameManager.gameManager.PlayerDataPool.NowDayIndex - 1].PlayEffect(); } DealWithButtonStates(); InitBox(); //setMonthBelle (); }