Beispiel #1
0
    void CreateItems()
    {
        IDictionaryEnumerator itr = DataManager.TotalChargeTable.GetEnumerator();

        while (itr.MoveNext())
        {
            TotalChargeTableItem item = TotalChargeModule.GetItem((int)itr.Key);

            if (item == null)
            {
                continue;
            }

            CreateItem(item);
        }
//         foreach(int key in DataManager.TotalChargeTable.Keys)
//         {
//             TotalChargeTableItem item = TotalChargeModule.GetItem(key);
//
//             if (item == null)
//                 continue;
//
//             CreateItem(item);
//         }
    }
Beispiel #2
0
    /// <summary>
    /// 礼包是否领取过,获得当前礼包需要充值钱数;
    /// </summary>
    void updateBoxInfo()
    {
        TotalChargeTableItem item = TotalChargeModule.GetItem(CurSelectObjId);

        if (item == null)
        {
            Debug.LogError("错了");
            return;
        }

        PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>();

        if (pdm == null)
        {
            return;
        }

        if (!pdm.GetTotalChargeRewardGot(CurSelectObjId))
        {
            mBoxBtn.normalSprite = "rewardpic1";
        }
        else
        {
            mBoxBtn.normalSprite = "rewardpic2";
        }
        mBoxBtn.GetComponent <UISprite>().MakePixelPerfect();

        mBoxMoney.text = item.giftPrice.ToString();
    }
Beispiel #3
0
    /// <summary>
    /// 还要充多少钱领什么东西;
    /// </summary>
    void updateCharge()
    {
        int max = TotalChargeModule.GetMaxRewardIdx();

        // 达到最大奖励提示;
        if (TotalChargeModule.IsLastRewardIdx(max))
        {
            mChargeLb.text = StringHelper.GetString("totalcharge_all_got");
            return;
        }

        TotalChargeTableItem item = TotalChargeModule.GetItem(max + 1);

        if (item == null)
        {
            Debug.LogError("totalCharge 表错了!");
            return;
        }

        PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>();

        if (pdm == null)
        {
            Debug.LogError("playerDataModule null 了");
            return;
        }

        int needNum = (int)(item.chargeNum - pdm.GetTotalChargeNum());

        mChargeLb.text = string.Format(StringHelper.GetString("totalcharge_detail"), needNum, item.giftPrice);
    }