Exemplo n.º 1
0
    void GetReward(bool bDouble)
    {
        DataPlayerController dpc  = DataPlayerController.getInstance();
        DataPlayer           _dp  = dpc.data;
        BCGameObjectType     type = WGDataController.Instance.GetBCObjType(curReward.reward);
        BCObj obj = WGDataController.Instance.GetBCObj(curReward.reward);

        switch (type)
        {
        case BCGameObjectType.Coin:
            _dp.Coin = _dp.Coin + curReward.got_num;
            if (bDouble)
            {
                _dp.Coin = _dp.Coin + curReward.got_num;
            }
            break;

        case BCGameObjectType.Collection:
            dpc.addCollectionNum(curReward.reward, curReward.got_num);
            if (bDouble)
            {
                dpc.addCollectionNum(curReward.reward, curReward.got_num);
            }
            break;

        case BCGameObjectType.Item:
            dpc.AddSkillNum(curReward.reward, curReward.got_num);
            if (bDouble)
            {
                dpc.AddSkillNum(curReward.reward, curReward.got_num);
            }
            break;

        case BCGameObjectType.Jewel:
            _dp.Jewel += curReward.got_num;
            if (bDouble)
            {
                _dp.Jewel += curReward.got_num;
            }
                        #if TalkingData
            TDGAVirtualCurrency.OnReward(curReward.got_num, "DailyReward");
                        #endif
                        #if Umeng
            Umeng.GA.Bonus(curReward.got_num, Umeng.GA.BonusSource.Source2);
                        #endif
            break;
        }

        _dp.lastDailyRewardTime = Core.now;

        dpc.saveDataPlayer();

        WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN | UI_FRESH.COIN);
    }
Exemplo n.º 2
0
 public void HideObj(GameObject g, float time)
 {
     if (_szLiveCoin.Contains(g))
     {
         _szLiveCoin.Remove(g);
         BCGameObj bcg = g.GetComponent <BCGameObj>();
         if (bcg != null)
         {
             BCGameObjectType tp = WGDataController.Instance.GetBCObjType(bcg.ID);
             if (tp == BCGameObjectType.Collection)
             {
                 _szDeskCollection[bcg.ID - 3000]--;
             }
         }
     }
     Destroy(g, time);
 }
Exemplo n.º 3
0
    public void freshDailyCell(int rewardID, int num, bool bDouble = false)
    {
        labX2.ESetActive(bDouble);

        BCGameObjectType type = WGDataController.Instance.GetBCObjType(rewardID);

        if (rewardID == 1001)
        {
            spRewardIcon.spriteName = "item1001";
//			spRewardIcon.transform.localScale = Vector3.one*0.85f;
        }
        else if (rewardID == 4001)
        {
            spRewardIcon.spriteName = "item4001";
//			spRewardIcon.MakePixelPerfect();
//			spRewardIcon.transform.localScale = Vector3.one*0.85f;
        }
        else if (type == BCGameObjectType.Item)
        {
            spRewardIcon.spriteName = "sb1" + rewardID;
//			spRewardIcon.transform.localScale = Vector3.one;
        }
        labGotNum.text = num.ToString();
    }
Exemplo n.º 4
0
    public void GetAllReward(bool bDouble = false, bool notgift = false)
    {
        DataPlayer       _DataPlayer = DataPlayerController.getInstance().data;
        WGDataController _dataCtrl   = WGDataController.Instance;
        int jewel = 0;

        for (int i = 0; i < szAllReward.Count; i++)
        {
            BCGameObjectType type = _dataCtrl.GetBCObjType(szAllReward[i][0]);
            switch (type)
            {
            case BCGameObjectType.Coin:

                _DataPlayer.Coin += szAllReward[i][1];
                if (bDouble)
                {
                    _DataPlayer.Coin += szAllReward[i][1];
                }
                break;

            case BCGameObjectType.Item:
                DataPlayerController.getInstance().AddSkillNum(szAllReward[i][0], szAllReward[i][1]);
                if (bDouble)
                {
                    DataPlayerController.getInstance().AddSkillNum(szAllReward[i][0], szAllReward[i][1]);
                }
                break;

            case BCGameObjectType.Jewel:
                if (notgift)
                {
                    if (bDouble)
                    {
                        _DataPlayer.Jewel += szAllReward[i][1];
                        jewel             += szAllReward[i][1];
                        _DataPlayer.Jewel += szAllReward[i][1];
                        jewel             += szAllReward[i][1];
                    }
                }
                else
                {
                    _DataPlayer.Jewel += szAllReward[i][1];
                    jewel             += szAllReward[i][1];
                    if (bDouble)
                    {
                        _DataPlayer.Jewel += szAllReward[i][1];
                        jewel             += szAllReward[i][1];
                    }
                }


                break;
            }
        }
        if (jewel > 0)
        {
            if (mRType == YHRewardType.Levelup)           //level up reward
            {
                //TDGAVirtualCurrency.OnReward(jewel,"LevelUp");
            }
        }
//		Dictionary<string, object> dic = new Dictionary<string, object>();
//		if(mRType != YHRewardType.Levelup && mRType != YHRewardType.Other)
//		{
//			dic.Add("result",WGStrings.getText(9002));
//			TalkingDataGA.OnEvent(labTitle.text,dic);
//		}
    }