Beispiel #1
0
    public void SetWipeResult(List <StageDC.StageSweepReward> sweepRewards)
    {
        CounterPartInfo info = StageDC.GetCounterPartInfo();

        if (info.type == (int)StageType.Normal)
        {
            MyHead.LblTitle.text = NGUIUtil.GetStringByKey(70000213);
        }
        else if (info.type == (int)StageType.Hard)
        {
            MyHead.LblTitle.text = NGUIUtil.GetStringByKey(70000214);
        }

        List <StageDC.StageSweepReward.ItemInfo> extraRewardItems = new List <StageDC.StageSweepReward.ItemInfo>();

        for (int i = 0; i < sweepRewards.Count; i++)
        {
            StageDC.StageSweepReward sweepReward = sweepRewards[i];
            GameObject go = Create(MyHead.SweepResultInfoTemplate, MyHead.StageWipeParent.transform);
            go.SetActive(true);
            SweepResultItem sweepResultItem = go.GetComponent <SweepResultItem>();
            sweepResultItem.SetSweepResult(sweepReward, i);
            mSweepResultItems.Add(sweepResultItem);
            extraRewardItems.AddRange(sweepReward.mExtraRewards);
        }

        GameObject goExtra = Create(MyHead.SweepResultInfoTemplate, MyHead.StageWipeParent.transform);

        goExtra.SetActive(true);
        SweepResultItem sweepExtraRewardItem = goExtra.GetComponent <SweepResultItem>();

        sweepExtraRewardItem.SetExtraRewardItems(extraRewardItems);
        mSweepResultItems.Add(sweepExtraRewardItem);
        MyHead.StageWipeParent.Reposition();
    }
Beispiel #2
0
 void Clear()
 {
     for (int i = 0; i < mSweepResultItems.Count; i++)
     {
         SweepResultItem sweepResultItem = mSweepResultItems[i];
         GameObject.DestroyImmediate(sweepResultItem.gameObject);
     }
     mSweepResultItems.Clear();
 }