Esempio n. 1
0
    void Reward(int id)
    {
        if (_CurrentID == _777Index)
        {
            BCSoundPlayer.Play(MusicEnum.tiger777);
        }

        MDTiger tiger = _szTigerInfo[id];

        WGAchievementManager.Self.processAchievement(tiger.ID, DTAchievementType.TIGER_ID);

        int _tempType = tiger.RewardType;

        //WG.SLog(SDK.Serialize(tiger));
        if (tiger.reward.Count > 0)
        {
            if (tigerCallBack != null)
            {
                tigerCallBack(1, tiger);
            }
//			showReward(tiger);
        }
        else
        {
            if (tigerCallBack != null)
            {
                tigerCallBack(0, tiger);
            }
        }
    }
Esempio n. 2
0
 void myTigerCallBack(int st, MDTiger tiger)
 {
     if (st == 1)
     {
         mTiger.ESetActive(false);
         showReward(tiger);
     }
     else if (st == 0)
     {
     }
 }
Esempio n. 3
0
    void showReward(MDTiger tiger)
    {
        YHMDPayData payData   = WGDataController.Instance.getYHMDPay(YHPayType.DOUBLE_reward);
        float       costMenoy = payData.payCost;
        string      payKey    = payData.payKey.ToString();
//		float costMenoy = 30f;
//		string payKey = "114";
//		if(YeHuoSDK.bUsePayCode2)
//		{
//			costMenoy = 20f;
//			payKey = "214";
//		}
        YHGotRewardView rdview = YHGotRewardView.CreateGotRewardView();

        rdview.mRType        = YHRewardType.SuperTiger;
        rdview.bDoubleReward = true;

        SDK.AddChild(rdview.gameObject, WGRootManager.Self.goRootTopUI);

        rdview.FreshRewardCell(tiger.reward);
                #if YES_OK
        string content = WGStrings.getFormateInt(1081, 1104, "", costMenoy.ToString());
                #elif YES_BUY
        string content = WGStrings.getFormateInt(1081, 1104, "", costMenoy.ToString());
#elif YES_GET
        string content = WGStrings.getFormateInt(1081, 1101, "", costMenoy.ToString());
#elif YES_QueRen
        string content = WGStrings.getFormateInt(1081, 1104, "", costMenoy.ToString());
                #else
        string content = WGStrings.getFormateInt(1081, 1101, "", costMenoy.ToString());
                #endif
        rdview.FreshWithMsg(WGStrings.getText(1100), content, false, false);
        rdview.alertViewBehavriour = (ab, view) => {
            switch (ab)
            {
            case MDAlertBehaviour.CLICK_OK:
                if (view.clickIndex == MDBaseAlertView.CLICK_OK1)
                {
                    view.hiddenView();
                    rdview.GetAllReward(false);
                    WGGameUIView.Instance.freshSkillNum();
                    WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN | UI_FRESH.COIN);
                }
                else if (view.clickIndex == MDBaseAlertView.CLICK_OK2)
                {
                    YeHuoSDK.YHPay(payKey, costMenoy, 0, (success) => {
                        view.hiddenView();
                        if (success)
                        {
                            rdview.GetAllReward(true);
                            WGGameUIView.Instance.freshSkillNum();
                            WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN | UI_FRESH.COIN);
                        }
                    });
                }
                break;

            case MDAlertBehaviour.DID_HIDDEN:
                mTiger.ESetActive(true);
                Destroy(view.gameObject);

                break;
            }
        };

        rdview.showView();
        BCSoundPlayer.Play(MusicEnum.showReward, 1f);
    }