Esempio n. 1
0
    public void UpdateRechargeList()
    {
        GCGame.Utils.CleanGrid(m_TransRechargeGrid.gameObject);

        Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

        if (null == mainPlayer)
        {
            LogModule.ErrorLog("main player is not init");
            return;
        }

        for (int i = 0; i < TableManager.GetRecharge().Count; i++)
        {
            Tab_Recharge curTabRecharge = TableManager.GetRechargeByID(i, 0);
            if (null == curTabRecharge)
            {
                continue;
            }

            if (!RechargeData.m_dicGoodInfos.ContainsKey(curTabRecharge.RegisterID))
            {
                continue;
            }

            RechargeData.GoodInfo curGoodInfo = RechargeData.m_dicGoodInfos[curTabRecharge.RegisterID];

            string          iconName     = "";
            string          goodName     = curGoodInfo.goods_number + "#y";
            bool            bEnableTimes = false;
            PayActivityData payData      = GameManager.gameManager.PlayerDataPool.PayActivity;
            if (curTabRecharge.Type == 1 && payData.IsMonthCardFlag())
            {
                // 月卡并且已经生效
                // TT9809 月卡也显示
                //continue;
            }
            if (curTabRecharge.Type == 2 && (payData.IsGrowUpFlag() || mainPlayer.BaseAttr.Level >= payData.GrowUpLevel))
            {
                // 成长基金并且已经生效或者玩家已经大于50级
                continue;
            }
            else if (curTabRecharge.Type == 3)
            {
                bEnableTimes = true;
            }
            iconName = curTabRecharge.IconName;
            goodName = curTabRecharge.GoodName;

            RechargeItem.CreateItem(m_ObjRechargeItem, m_TransRechargeGrid, curGoodInfo.goods_register_id, iconName, curGoodInfo.goods_price, goodName, curTabRecharge.HotLabelTip, bEnableTimes);
        }

        UIGrid curGrid = m_TransRechargeGrid.GetComponent <UIGrid>();

        if (null != curGrid)
        {
            curGrid.repositionNow = true;
        }
    }
Esempio n. 2
0
    public void OnMakePay(string id, int times)
    {
        float timeDiff = Time.time - m_lastPayTime;

        if (timeDiff < 3)
        {
            Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;
            if (null != mainPlayer)
            {
                mainPlayer.SendNoticMsg(false, "#{1076}");
            }
            return;
        }

        m_lastPayTime = Time.time;

        RechargeData.GoodInfo curGoodInfo = RechargeData.GetGoodInfo(id);
        if (null == curGoodInfo)
        {
            LogModule.ErrorLog(" can not find cur good info:" + id.ToString());
            return;
        }

        // 遍历充值表,判断是否为月卡
        for (int i = 0; i < TableManager.GetRecharge().Count; i++)
        {
            Tab_Recharge curTabRecharge = TableManager.GetRechargeByID(i, 0);
            if (null == curTabRecharge)
            {
                continue;
            }

            if (curTabRecharge.RegisterID == id)
            {
                if (curTabRecharge.Type == 1 &&
                    GameManager.gameManager.PlayerDataPool.PayActivity.IsMonthCardFlag())
                {
                    // 如果是月卡并且正在生效,提示不能购买
                    MessageBoxLogic.OpenOKBox(StrDictionary.GetClientDictionaryString("#{4636}",
                                                                                      GameManager.gameManager.PlayerDataPool.PayActivity.GetMonthCardLeftDay()));
                    return;
                }
                else
                {
                    break;
                }
            }
        }

        if (times > 1)
        {
            curGoodInfo = curGoodInfo.GetGoodInfoWithTimes(times);
        }

        if (null == curGoodInfo)
        {
            LogModule.ErrorLog("pay stop:good info error");
            return;
        }

        PlatformHelper.MakePayWithGoodInfo(curGoodInfo);
    }