/// <summary> /// 初始化条目内容 /// </summary> public void initItem(GodsWarPrizeSample sample, WindowBase win, CallBack callback) { this.data = sample; this.callback = callback; this.fwin = win; initPrize(); initButtons(); }
public override void copy(object destObj) { base.copy(destObj); GodsWarPrizeSample dest = destObj as GodsWarPrizeSample; if (this.item != null) { dest.item = new List <PrizeSample> (); for (int i = 0; i < this.item.Count; i++) { dest.item.Add(this.item [i].Clone() as PrizeSample); } } }
public void init(GodsWarPrizeSample info, int index, WindowBase win) { this.info = info; this.win = win; bool canReceived = false; lblCondition.text = ""; completedIcon.SetActive(false); bg01.gameObject.SetActive(false); firstAwardLogo.gameObject.SetActive(false); title.gameObject.SetActive(false); lblName.text = info.des; lblName.effectStyle = UILabel.Effect.Outline; lblName.effectColor = new Color(33f / 255, 59f / 255, 87f / 255); lblName.transform.localPosition = new Vector3(0, 86, 0); string currentState = GodsWarManagerment.Instance.getGodsWarStateInfo(); if (currentState.EndsWith("zige_group")) { if (index == 0) { firstAwardLogo.gameObject.SetActive(true); title.gameObject.SetActive(false); lblName.gameObject.SetActive(false); } else { firstAwardLogo.gameObject.SetActive(false); title.gameObject.SetActive(true); lblName.gameObject.SetActive(true); lblName.gameObject.transform.localPosition = new Vector3(0, lblName.gameObject.transform.localPosition.y, lblName.gameObject.transform.localPosition.z); } } else if (currentState.EndsWith("zige_final") || currentState.EndsWith("zige_taotai")) { firstAwardLogo.gameObject.SetActive(true); firstAwardLogo.spriteName = "medal_" + (index + 1); if (index > 3) { firstAwardLogo.spriteName = "medal_4"; } title.gameObject.SetActive(false); lblName.gameObject.SetActive(true); lblName.gameObject.transform.localPosition = new Vector3(0, lblName.gameObject.transform.localPosition.y - 10, lblName.gameObject.transform.localPosition.z); } int pos = 0; Utils.DestoryChilds(content.gameObject); for (int i = 0; i < info.item.Count; i++) { PrizeSample ps = info.item [i]; if (win is GodsWarFinalRankWindow) { GameObject obj = NGUITools.AddChild(content.gameObject, (win as GodsWarFinalRankWindow).goodsViewPrefab); GoodsView sc = obj.GetComponent <GoodsView> (); sc.init(ps); sc.fatherWindow = win; obj.transform.localScale = new Vector3(0.9f, 0.9f, 1); obj.transform.localPosition = new Vector3(pos * 100 - 10, 0, 0); pos++; } if (win is GodsWarIntegralRankAwardWindow) { GameObject obj = NGUITools.AddChild(content.gameObject, (win as GodsWarIntegralRankAwardWindow).goodsViewPrefab); GoodsView sc = obj.GetComponent <GoodsView> (); sc.init(ps); sc.fatherWindow = win; obj.transform.localScale = new Vector3(0.95f, 0.95f, 1); obj.transform.localPosition = new Vector3(pos * 110 - 20, 0, 0); pos++; } } }
//解析配置 public override void parseConfig(string str) { GodsWarPrizeSample be = new GodsWarPrizeSample(str); if (be.type == TYPE_1) { if (listFinall == null) { listFinall = new List <GodsWarPrizeSample>(); } listFinall.Add(be); } else if (be.type == TYPE_2) { if (list == null) { list = new List <GodsWarPrizeSample>(); } list.Add(be); } else if (be.type == TYPE_3) { if (listIntegralRank == null) { listIntegralRank = new List <GodsWarPrizeSample>(); } listIntegralRank.Add(be); } else if (be.type == TYPE_33) { if (listIntegralRankYin == null) { listIntegralRankYin = new List <GodsWarPrizeSample>(); } listIntegralRankYin.Add(be); } else if (be.type == TYPE_333) { if (listIntegralRankJin == null) { listIntegralRankJin = new List <GodsWarPrizeSample>(); } listIntegralRankJin.Add(be); } else if (be.type == TYPE_4) { if (listIntegral == null) { listIntegral = new List <GodsWarPrizeSample>(); } listIntegral.Add(be); } else if (be.type == TYPE_5) { if (listSuport == null) { listSuport = new List <GodsWarPrizeSample>(); } listSuport.Add(be); } else if (be.type == TYPE_6) { if (listFianlAwardBronze == null) { listFianlAwardBronze = new List <GodsWarPrizeSample>(); } listFianlAwardBronze.Add(be); } else if (be.type == TYPE_7) { if (listFianlAwardSilver == null) { listFianlAwardSilver = new List <GodsWarPrizeSample>(); } listFianlAwardSilver.Add(be); } else if (be.type == TYPE_8) { if (listFianlAwardGold == null) { listFianlAwardGold = new List <GodsWarPrizeSample>(); } listFianlAwardGold.Add(be); } }