public int getCanReceiveNum() { if (ReceiveSidList == null) { InitData(null); return(0); } int num = 0; System.Collections.Hashtable table = HappySundaySampleManager.Instance.samples; System.DateTime date = TimeKit.getDateTime(ServerTimeKit.getSecondTime()); int onlineDay = (ServerTimeKit.getSecondTime() - ServerTimeKit.onlineTime) / 3600 / 24; foreach (System.Collections.DictionaryEntry item in table) { HappySundaySample sample = item.Value as HappySundaySample; if (sample.OnlineDay > onlineDay || sample.MaxScore >= CurrentScore) //sample.Week != (int)date.DayOfWeek || { continue; } if (!ReceiveSidList.Contains(sample.Sid)) { num++; } } return(num); }
//解析模板数据 public override void parseSample(int sid) { HappySundaySample sample = new HappySundaySample(); string dataStr = getSampleDataBySid(sid); sample.parse(sid, dataStr); samples.Add(sid, sample); }
public void SetData(HappySundaySample baseData, WindowBase faterWindow) { mBaseData = baseData; int currentScore = Mathf.Min(baseData.MaxScore, HappySundayManagerment.Instance.CurrentScore); UI_TitleLabel.text = string.Format(LanguageConfigManager.Instance.getLanguage("s0564"), "[ffcc00]" + baseData.MaxScore + "[-]"); UI_Progress.value = (float)currentScore / (float)baseData.MaxScore; UI_ProgressLabel.text = currentScore + "/" + baseData.MaxScore; for (int i = 0; i < baseData.AwardGoods.Length; i++) { GoodsView goods = NGUITools.AddChild(UI_GoodsContainer.gameObject, UI_GoodsTemplate.gameObject).GetComponent <GoodsView>(); goods.init(baseData.AwardGoods[i].type, baseData.AwardGoods[i].sid, baseData.AwardGoods[i].num); goods.fatherWindow = faterWindow; } UI_GoodsContainer.GetComponent <UIGrid>().Reposition(); updateReceiveBtn(); }
private void onReceiveInit() { System.Collections.Hashtable table = HappySundaySampleManager.Instance.samples; System.DateTime date = TimeKit.getDateTime(ServerTimeKit.getSecondTime()); int onlineDay = (ServerTimeKit.getSecondTime() - ServerTimeKit.onlineTime) / 3600 / 24; foreach (System.Collections.DictionaryEntry item in table) { HappySundaySample sample = item.Value as HappySundaySample; ActiveTime activeTime = ActiveTime.getActiveTimeByID(sample.timeID); if (sample.OnlineDay > onlineDay || activeTime.getIsFinish()) { continue; } HappySundayContentItem target = Instantiate(UI_ItemTemplate) as HappySundayContentItem; target.transform.parent = UI_ItemContainer; target.transform.localScale = Vector3.one; target.SetData(sample, mFatherWindow); } UI_ItemContainer.GetComponent <UIGrid>().Reposition(); }