/// <summary> /// 加载数据 /// </summary> public void loadPrize() { Utils.RemoveAllChild(signAwardContent.transform); updateUI(); int ssid = StringKit.toInt(notice.sid + "" + ServerTimeKit.getCurrentMonth()); SignInSample sample = SignInSampleManager.Instance.getSignInSampleBySid(ssid); if (sample == null) { return; } allSignPrize = sample.allSignPrize; allSignSid = sample.allSignSid; List <PrizeSample> prize = sample.list; List <int> sids = sample.daySids; //日期sid List <int> types = sample.types; //奖励类型(用于背景的显示) for (int i = 0; i < count; i++) { GameObject signBtn = NGUITools.AddChild(signAwardContent, signInButton); signBtn.transform.localScale = new Vector3(0.55f, 0.55f, 0); signBtn.transform.localPosition = new Vector3(-216 + (int)(i % 7) * 71, 155 - (int)(i / 7) * 80, 0); SignInButton signIn = signBtn.GetComponent <SignInButton>(); signIn.init(this); if (SignInManagerment.Instance.stateList.Contains(sids[i]))//签过的 { signIn.init(prize[i], SIGN_IN_YES, i + 1, sids[i], types[i]); } else { signIn.init(prize[i], SIGN_IN_NO, i + 1, sids[i], types[i]); } signIn.fatherWindow = win; } GameObject allSignPrizeObj = NGUITools.AddChild(allSignAwardPoint, goodsView); allSignPrizeObj.transform.localScale = new Vector3(0.8f, 0.8f, 0); allSignPrizeObj.GetComponent <GoodsView>().init(allSignPrize); allSignPrizeObj.GetComponent <GoodsView>().fatherWindow = win; }