Пример #1
0
    public override void initButton(int i)
    {
        if (sample.type == NoticeType.EXCHANGENOTICE || sample.type == NoticeType.NEW_EXCHANGE)
        {
            if (nodeList [i] == null)
            {
                nodeList [i] = NGUITools.AddChild(gameObject, (activityBase as NoticeActivityExchangeContent).NoticeActivityExchangePrefab);
            }
            nodeList [i].name = StringKit.intToFixString(i + 1);
            NoticeActivityExchangeBarCtrl ctrl = nodeList [i].GetComponent <NoticeActivityExchangeBarCtrl> ();
            ctrl.fatherWindow = activityBase as NoticeActivityExchangeContent;
            ctrl.updateItem(exchangeList [i]);
        }
        else if (sample.type == NoticeType.TOPUPNOTICE || sample.type == NoticeType.COSTNOTICE || sample.type == NoticeType.TIME_RECHARGE ||
                 sample.type == NoticeType.NEW_RECHARGE || sample.type == NoticeType.NEW_CONSUME)
        {
            if (nodeList [i] == null)
            {
                nodeList [i] = NGUITools.AddChild(gameObject, (activityBase as NoticeActivityRechargeContent).NoticeActivityRechargePrefab);
            }

            nodeList [i].name = StringKit.intToFixString(i + 1);
            NoticeActivityRechargeBarCtrl ctrl = nodeList [i].GetComponent <NoticeActivityRechargeBarCtrl> ();
            ctrl.fatherWindow = activityBase as NoticeActivityRechargeContent;
            ctrl.updateItem(rechargeList [i], sample, notice);
        }
        else if (sample.type == NoticeType.CONSUME_REBATE)
        {
            if (nodeList [i] == null)
            {
                nodeList [i] = NGUITools.AddChild(gameObject, (activityBase as NoticeConsumeRebateContent).noticeActivityShopPrefab);
            }
            nodeList [i].name = StringKit.intToFixString(i + 1);
            NoticeActivityShopBarCtrl ctrl = nodeList [i].GetComponent <NoticeActivityShopBarCtrl> ();
            ctrl.fatherContent = activityBase as NoticeConsumeRebateContent;
            ctrl.updateItem(consumeRebateList [i], sample);
        }
        else if (sample.type == NoticeType.ONE_MANY_RECHARGE)
        {
            if (nodeList[i] == null)
            {
                nodeList[i] = NGUITools.AddChild(gameObject, (activityBase as NoticeOneManyRechargeContent).NoticeOneManyRechargePrefab);
            }
            nodeList[i].name = StringKit.intToFixString(i + 1);
            NoticeOneManyRechargeItem ctrl = nodeList[i].GetComponent <NoticeOneManyRechargeItem>();
            ctrl.fatherWindow = activityBase as NoticeOneManyRechargeContent;
            ctrl.updateItem(rechargeList[i], sample, notice);
        }
    }
Пример #2
0
 public override void updateItem(GameObject item, int index)
 {
     if (sample.type == NoticeType.EXCHANGENOTICE || sample.type == NoticeType.NEW_EXCHANGE)
     {
         NoticeActivityExchangeBarCtrl ctrl = item.GetComponent <NoticeActivityExchangeBarCtrl> ();
         ctrl.updateItem(exchangeList [index]);
     }
     else if (sample.type == NoticeType.TOPUPNOTICE || sample.type == NoticeType.COSTNOTICE || sample.type == NoticeType.TIME_RECHARGE ||
              sample.type == NoticeType.NEW_RECHARGE || sample.type == NoticeType.NEW_CONSUME)
     {
         NoticeActivityRechargeBarCtrl ctrl = item.GetComponent <NoticeActivityRechargeBarCtrl> ();
         ctrl.updateItem(rechargeList [index], sample, notice);
     }
     else if (sample.type == NoticeType.CONSUME_REBATE)
     {
         NoticeActivityShopBarCtrl ctrl = item.GetComponent <NoticeActivityShopBarCtrl> ();
         ctrl.updateItem(consumeRebateList [index], sample);
     }
     else if (sample.type == NoticeType.ONE_MANY_RECHARGE)
     {
         NoticeOneManyRechargeItem itemCtrl = item.GetComponent <NoticeOneManyRechargeItem>();
         itemCtrl.updateItem(rechargeList[index], sample, notice);
     }
 }