Esempio n. 1
0
    public void InitData()
    {
        CostRebateData costRebate = GameManager.gameManager.PlayerDataPool.CostRebate;
        int            costValue  = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_COSTREBATE_VALUE);

        m_RebateValue.text  = costValue.ToString();
        m_StartEndTime.text = costRebate.GetStartEndTineString();
        m_CostTypeDesc.text = costRebate.GetCostDescString();
        for (int i = 0; i < costRebate.RebateLimit.Length; i++)
        {
            if (costRebate.RebateLimit[i] != -1)
            {
                m_RebateUnit[i].gameObject.SetActive(true);
                m_RebateUnit[i].InitData(i);
            }
            else
            {
                m_RebateUnit[i].gameObject.SetActive(false);
            }
        }
        m_UnitGrid.sorted        = true;
        m_UnitGrid.repositionNow = true;

        if (ChargeActivityLogic.Instance() != null)
        {
            ChargeActivityLogic.Instance().UpdateRemainTips();
        }
    }
Esempio n. 2
0
    public static bool IsNeedClickToday()
    {
        // 消费返利开启 并且 今天没有点击过
        CostRebateData costRebate = GameManager.gameManager.PlayerDataPool.CostRebate;

        if (costRebate.CostRebateOpen && GameManager.gameManager.PlayerDataPool.IsClickCostRebate == false)
        {
            return(true);
        }
        return(false);
    }
    public void InitData(int unitIndex)
    {
        CostRebateData costRebate = GameManager.gameManager.PlayerDataPool.CostRebate;
        int            costValue  = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_COSTREBATE_VALUE);

//        int costType = costRebate.CostType;
        if (unitIndex >= 0 &&
            unitIndex < costRebate.RebateLimit.Length &&
            unitIndex < costRebate.RebateId1.Length &&
            unitIndex < costRebate.RebateId2.Length &&
            unitIndex < costRebate.RebateId3.Length &&
            unitIndex < costRebate.RebateNum1.Length &&
            unitIndex < costRebate.RebateNum2.Length &&
            unitIndex < costRebate.RebateNum3.Length)
        {
            int  limit = costRebate.RebateLimit[unitIndex];
            int  id1   = costRebate.RebateId1[unitIndex];
            int  id2   = costRebate.RebateId2[unitIndex];
            int  id3   = costRebate.RebateId3[unitIndex];
            int  num1  = costRebate.RebateNum1[unitIndex];
            int  num2  = costRebate.RebateNum2[unitIndex];
            int  num3  = costRebate.RebateNum3[unitIndex];
            bool flag  = costRebate.RebateFlag[unitIndex];

            m_LimitLabel.text    = Utils.ConvertLargeNumToString_10w(limit);
            m_CostTypeLabel.text = costRebate.GetCostTypeString();
            if (costValue >= limit)
            {
                if (flag == true)
                {
                    //已领取
                    m_GetButton.isEnabled = false;
                    m_GetButtonLabel.text = StrDictionary.GetClientDictionaryString("#{1380}"); //已领取
                }
                else
                {
                    //可以领取
                    m_GetButton.isEnabled = true;
                    m_GetButtonLabel.text = StrDictionary.GetClientDictionaryString("#{1378}"); //领取
                }
            }
            else
            {
                //未领取
                m_GetButton.isEnabled = false;
                m_GetButtonLabel.text = StrDictionary.GetClientDictionaryString("#{1379}"); //未领取
            }
            ShowPrizeItem(m_PrizeItem1, id1, num1);
            ShowPrizeItem(m_PrizeItem2, id2, num2);
            ShowPrizeItem(m_PrizeItem3, id3, num3);

            m_UnitIndex = unitIndex;
        }
    }
    public void RefreshCostRebate()
    {
        CostRebateData crd = GameManager.gameManager.PlayerDataPool.CostRebate;

        if (CostRebateGo != null)
        {
            NGUITools.SetActive(CostRebateGo, crd.CostRebateOpen);
        }
        if (crd.CostRebateOpen && NowType == ActivityRewardType.Cost)
        {
            costData = crd.CostRebateDataList;
            RefreshAllInfo();
        }
    }
Esempio n. 5
0
    public static bool IsRebateCanGet()
    {
        CostRebateData costRebate = GameManager.gameManager.PlayerDataPool.CostRebate;
        int            costValue  = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_COSTREBATE_VALUE);

        for (int i = 0; i < (int)COSTREBATE.UNIT_MAX; i++)
        {
            if (costRebate.RebateLimit[i] > 0)
            {
                if (costValue >= costRebate.RebateLimit[i] && costRebate.RebateFlag[i] == false)
                {
                    return(true);
                }
            }
        }
        return(false);
    }
    public void ButtonClickCost()//xiaofei
    {
        if (nowtype == ActivityRewardType.Cost)
        {
            return;
        }
        nowtype  = ActivityRewardType.Cost;
        nowlabel = yuanbaoLabel0;
        if (SelectSprite != null)
        {
            SelectSprite.spriteName = UnSelectName;
        }
        SelectSprite = ButtonUISprite[(int)ActivityRewardType.Cost];
        if (SelectSprite != null)
        {
            SelectSprite.spriteName = SelectName;
        }
        lastyuanbao = int.MaxValue;
        NGUITools.SetActive(XiaofeiXianshiWindow, true);
        NGUITools.SetActive(XiaofeiWindow, true);
        NGUITools.SetActive(XianshiWindow, false);
        NGUITools.SetActive(DengjiZhanliWindow, false);
        CostRebateData crd = GameManager.gameManager.PlayerDataPool.CostRebate;

        if (CostTimeLimitLabel != null)
        {
            CostTimeLimitLabel.text = crd.GetCostDescString();/*StrDictionary.GetClientDictionaryString("#{11252}", 1, 2, 3, 4, 5, 6);*/
        }
        if (CostTimeLimitDecLabel != null)
        {
            CostTimeLimitDecLabel.text = crd.GetStartEndTineString();
        }
//        int num = costData.Count;
        Transform tf = XiaofeiWindow.transform.Find("TabWindow/Grid");

        if (tf != null)
        {
            AdjustmentAllItem(costData, tf);
        }
    }
    void InitButton()
    {
        m_ShouChongButton.gameObject.SetActive(false);
        m_ShouZhouButton.gameObject.SetActive(false);
        m_ShouYueButton.gameObject.SetActive(false);
        m_ChengZhangButton.gameObject.SetActive(false);
        m_WishingWellButton.gameObject.SetActive(false);
        m_CostRebateButton.gameObject.SetActive(false);
        m_SpecialTimePayRebateButton.gameObject.SetActive(false);
        m_DayCardButton.gameObject.SetActive(false);

        PayActivityData payData        = GameManager.gameManager.PlayerDataPool.PayActivity;
        int             playerLevel    = GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level;
        TabButton       m_SelectButton = null;

        //首充
        if (payData.IsFirstTimeFlag() == false)
        {
            m_ShouChongButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_ShouChongButton;
            }
        }
        //首周
        if (payData.IsFirstWeekOver() == false && payData.IsFirstTimeFlag() == true)
        {
            m_ShouZhouButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_ShouZhouButton;
            }
        }
        //招财进宝 可重复购买 界面一直有
        {
            m_ShouYueButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_ShouYueButton;
            }
        }
        //成长
        if (payData.IsGrowUpFlag() == true)
        {
            if (payData.IsGrowUpOver() == false)
            {
                m_ChengZhangButton.gameObject.SetActive(true);
                if (m_SelectButton == null)
                {
                    m_SelectButton = m_ChengZhangButton;
                }
            }
        }
        else
        {
            if (playerLevel < payData.GrowUpLevel)
            {
                m_ChengZhangButton.gameObject.SetActive(true);
                if (m_SelectButton == null)
                {
                    m_SelectButton = m_ChengZhangButton;
                }
            }
        }
        //许愿池
        if (GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_WISHING))
        {
            int intime = GameManager.gameManager.PlayerDataPool.WishingWell_InTime;
            if (intime > 0)
            {
                m_WishingWellButton.gameObject.SetActive(true);
                if (m_SelectButton == null)
                {
                    m_SelectButton = m_WishingWellButton;
                }
            }
        }
        //消费返利
        CostRebateData costRebate = GameManager.gameManager.PlayerDataPool.CostRebate;

        if (costRebate.CostRebateOpen == true)
        {
            m_CostRebateButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_CostRebateButton;
            }
        }

        SpecialTimePayRebateData specialPayRebate = GameManager.gameManager.PlayerDataPool.SpecailTimePayRebate;

        if (specialPayRebate.SpecialTimePayRebateOpen == true)
        {
            m_SpecialTimePayRebateButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_SpecialTimePayRebateButton;
            }
        }

        //日卡
        if (payData.DayCardOpen && payData.IsDayCardFlag() == false)
        {
            m_DayCardButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_DayCardButton;
            }
        }

        m_ButtonGrid.repositionNow = true;
        if (null != m_SelectButton)
        {
            m_TabController.OnTabClicked(m_SelectButton);
        }

        if (m_ShouZhouButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickChargeActivitySZ = true;
        }
        if (m_ShouYueButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickChargeActivitySY = true;
        }
        if (m_ChengZhangButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickChargeActivityCZ = true;
        }
        if (m_WishingWellButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickWishingWell = true;
        }
        if (m_CostRebateButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickCostRebate = true;
        }
        if (m_SpecialTimePayRebateButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickSpecialTimePayRebate = true;
        }
        if (m_DayCardButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickDayCard = true;
        }
        UpdateRemainTips();
    }