コード例 #1
0
    public override void parseConfig(string str)
    {
        LaddersAwardSample sample = new LaddersAwardSample(str);

        sample.index = index;
        samples.Add(sample);
        index++;
    }
コード例 #2
0
    /// <summary>
    /// 更新奖励
    /// </summary>
    /// <param name="_data">_data.</param>
    public void M_update(LaddersAwardSample _data)
    {
        data            = _data;
        label_name.text = data.name;

        PrizeSample[] prizes = data.samples;
        GameObject    newGo;
        GoodsView     goodsButton;

        UIUtils.M_removeAllChildren(root_prize);
        for (int i = 0, length = prizes.Length; i < length; i++)
        {
            newGo = NGUITools.AddChild(root_prize, prefab_GoodsView);
            newGo.SetActive(true);
            newGo.name = StringKit.intToFixString(i + 1);
            newGo.GetComponent <UIDragScrollView> ().scrollView = parentScrollView;
            goodsButton = newGo.GetComponent <GoodsView> ();
            //goodsButton.fatherWindow = this;
            //goodsButton.onClickCallback = goodsButton.DefaultClickEvent;
            goodsButton.init(prizes [i]);
        }
        root_prize.GetComponent <UIGrid> ().Reposition();


        LaddersMedalSample medal = LaddersConfigManager.Instance.config_Medal.M_getMedal(_data.minRank);

        //不存在奖章奖励时,显示:排名500名以外,无奖章奖励
        if (medal == null)
        {
            HideMedalInfo();
        }
        //存在奖章奖励时,显示奖章奖励
        else
        {
            ShowMedalInfo(medal);
        }

        /*
         * if(data.index>=5)
         * {
         *      sprite_nomal_bg.gameObject.SetActive(true);
         *      sprite_medal_bg.gameObject.SetActive(false);
         * }else
         * {
         *      sprite_nomal_bg.gameObject.SetActive(false);
         *      sprite_medal_bg.gameObject.SetActive(true);
         *      sprite_medal_bg.spriteName="medal_"+(data.index+1);
         * }
         */
    }
コード例 #3
0
    /// <summary>
    /// 更新视图
    /// </summary>
    private void M_updateView()
    {
        LaddersAwardInfo award = LaddersManagement.Instance.Award;

        btn_receive.disableButton(!award.canReceive);

        LaddersAwardSample sample = LaddersConfigManager.Instance.config_Award.M_getAward(award.rank);

        if (sample != null)
        {
            M_updateAwardSample(sample.samples);
        }
        LaddersTitleSample titlesample = LaddersManagement.Instance.M_getCurrentPlayerTitle();
        LaddersMedalSample medalsample = LaddersConfigManager.Instance.config_Medal.M_getMedal(award.rank);

        updateTitle(titlesample, medalsample);
    }