public void InitPrize()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;
        int             totalYB = payData.MonthCardYBTotal;

        if (totalYB == 0)
        {
            m_ProcessBar.value = 0;
        }
        else
        {
            m_ProcessBar.value = (float)totalYB / (30 * 50);
        }
        m_TotalYBLabel.text = StrDictionary.GetClientDictionaryString("#{5104}", totalYB);

        if (payData.IsMonthCardFlag() == true &&        //已经触发月卡
            payData.IsMonthCardOver() == false &&       //月卡未领取结束
            payData.IsMonthCardTodayFlag() == false)    //今日未领取月卡
        {
            m_GetButton.isEnabled = true;
            m_RemainTips.gameObject.SetActive(true);
        }
        else
        {
            m_GetButton.isEnabled = false;
            m_RemainTips.gameObject.SetActive(false);
        }

        if (ChargeActivityLogic.Instance() != null)
        {
            ChargeActivityLogic.Instance().UpdateRemainTips();
        }
    }
Example #2
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;
        }
    }
    public static bool IsMonthCardCanGet()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;

        if (payData.IsMonthCardFlag() == true &&        //已经触发月卡
            payData.IsMonthCardOver() == false &&       //月卡未领取结束
            payData.IsMonthCardTodayFlag() == false)    //今日未领取月卡
        {
            return(true);
        }
        return(false);
    }
    void OnClickGet()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;

        if (payData.IsMonthCardFlag() == false)
        {
            return;
        }

        if (payData.IsMonthCardOver() == true)
        {
            return;
        }

        if (payData.IsMonthCardTodayFlag() == true)
        {
            return;
        }
        //发包领奖
        payData.SendMonthCardPacket();
    }
Example #5
0
    // 支付
    public static void MakePay()
    {
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            if (GetChannelType() == ChannelType.IOS_APPSTORE || GetChannelType() == ChannelType.IOS_APPSTORE_TEST)
            {
#if UNITY_IPHONE && !UNITY_EDITOR
                IOSHelper.makePay(string.Format("{0:X16}", PlayerPreferenceData.LastRoleGUID), PlayerPreferenceData.LastServer.ToString());
#endif
                return;
            }
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            if (GameManager.gameManager == null || GameManager.gameManager.PlayerDataPool == null)
            {
                return;
            }
            PayActivityData payActivityData = GameManager.gameManager.PlayerDataPool.PayActivity;

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            JsonWriter writer            = new JsonWriter(sb);
            writer.WriteObjectStart();
            writer.WritePropertyName("ROLEID");
            writer.Write(string.Format("{0:X16}", PlayerPreferenceData.LastRoleGUID));
            writer.WritePropertyName("UID");
            writer.Write(LoginData.accountData.m_userID);
            writer.WritePropertyName("SERVERID");
            writer.Write(PlayerPreferenceData.LastServer.ToString());
            writer.WritePropertyName("OID");
            writer.Write(LoginData.accountData.m_oid);
            writer.WritePropertyName("TOKEN");
            writer.Write(LoginData.accountData.m_accessToken);
            writer.WritePropertyName("ROLENAME");
            writer.Write(LoginData.m_sRoleName);
            if (PlatformHelper.IsChannelTW())
            {
                // 成长基金
                writer.WritePropertyName("CZJJ_SHOWFLAG");
                writer.Write(payActivityData.IsGrowUpFlag() == true ? "0" : "1");
                // 招财进宝
                writer.WritePropertyName("ZCJB_SHOWFLAG");
                writer.Write(payActivityData.IsMonthCardFlag() == true ? "0" : "1");
                writer.WritePropertyName("ZCJB_SURPLUSDAY");
                writer.Write(payActivityData.GetMonthCardLeftDay().ToString());
            }
            LoginData.PlayerRoleData curRole = LoginData.GetPlayerRoleData(PlayerPreferenceData.LastRoleGUID);
            if (null != curRole)
            {
                writer.WritePropertyName("ROLELEVEL");
                writer.Write(curRole.level.ToString());
            }
            writer.WriteObjectEnd();

            AndroidHelper.doSdk("doOrder", sb.ToString());
#endif
            return;
        }

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