Esempio n. 1
0
    public void OnBuyWithMDShopData(MDShopData data)
    {
#if UNITY_ANDROID
        sCurBuy = "" + data.proid2;

        YeHuoSDK.YHPay(sCurBuy, (float)data.cost_num, data.get_num, (success) => {
            if (success)
            {
                for (int i = 0; i < szIAPData.Count; i++)
                {
                    if (sCurBuy.Equals(szIAPData[i].proid2))
                    {
                        _dataPlayer.Jewel += szIAPData[i].get_num;

                        DataPlayerController.getInstance().saveDataPlayer();
                        WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN);
                        WGAlertViewController.Self.showTipView(1001);
                    }
                }
            }
        });
#else
        WGAlertViewController.Self.showConnecting();
                #if TEST
        mnIvokeBlock.InvokeBlock(0.3f, () => {
            didCompleteWithRecepit("", data.proid);
        });
                #elif TBSDK
        if (TBSDK.TBIsLogined())
        {
            string order = data.proid + "_" + Core.nData.sysTime + "_" + TBSDK.TBUserID();

            Debug.Log(order);

            ShopOrderManager.getInstance().SetOrderDes(order, data.proid);
            ShopOrderManager.getInstance().setOrderStatu(order, ShopOrderManager.BuyingStates);
            ShopOrderManager.getInstance().saveShopOrder();
            TBSDK.TBPayRMB(data.cost_num, order, data.proid);
        }
        else
        {
            TBSDK.TBLogin(0);
        }
                #else
        IAP.payForProIdentifier(data.proid);
                #endif
#endif
    }
Esempio n. 2
0
    void OnBtnRelease()
    {
        if (mSkillNum > 0)
        {
            if (_dataPlayer.defenseTime > 0 && mSkillID == WGDefine.SK_FangYu4)
            {
                return;
            }
            if (bCanRelease)
            {
                beginTime   = Time.realtimeSinceStartup;
                bCanRelease = false;
                spIconEffect.ESetActive(true);
                spIconEffect.fillAmount = 1;

                if (myReleaseSkill != null)
                {
#if Umeng
                    Umeng.GA.Use(mSkillID.ToString(), 1, 10);
#endif
                                        #if TalkingData
                    MDSkill sk = WGDataController.Instance.getSkill(mSkillID);
                    TDGAItem.OnUse(sk.name, 1);
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("name", sk.name);
                    TalkingDataGA.OnEvent("使用道具", dic);
                                        #endif
                    myReleaseSkill(mSkillID);
                }
                mSkillNum--;
                labNum.text = mSkillNum.ToString();
                if (mSkillNum > 0)
                {
                    labNum.color = Color.white;
                }
                else
                {
                    labNum.color = Color.red;
                }

                DataPlayerController.getInstance().setSkillNum(mSkillID, mSkillNum);
            }
        }
        else
        {
            if (!WGAlertManager.Self.bBuySKill)
            {
                WGAlertManager.Self.bBuySKill = true;
                WGAlertManager.Self.AddAction(() => {
                    YHMDPayData payData = WGDataController.Instance.getYHMDPay(YHPayType.ITEM);
                    float costMenoy     = payData.payCost;
                    string payKey       = payData.payKey.ToString();
//					float costMenoy = 30;
//					string payKey = "106";
//					if(YeHuoSDK.bUsePayCode2)
//					{
//						costMenoy = 20;
//						payKey = "206";
//					}
                    YHGotRewardView rdview = YHGotRewardView.CreateGotRewardView();
                    rdview.mRType          = YHRewardType.Item;
                    SDK.AddChild(rdview.gameObject, WGRootManager.Self.goRootTopUI);
                    rdview.FreshRewardCell(_dataCtrl.mAllReward.item);
                                        #if YES_OK
                    string content = WGStrings.getFormateInt(1081, 1002, 1088, costMenoy.ToString());
                                        #elif YES_BUY
                    string content = WGStrings.getFormateInt(1081, 1094, 1088, costMenoy.ToString());
#elif YES_GET
                    string content = WGStrings.getFormateInt(1081, 1077, 1088, costMenoy.ToString());
#elif YES_QueRen
                    string content = WGStrings.getFormateInt(1081, 1106, payData.showText, costMenoy.ToString());
                                        #else
                    string content = WGStrings.getFormateInt(1081, 1077, payData.showText, costMenoy.ToString());
                                        #endif
                    rdview.FreshWithMsg(WGStrings.getText(1088), content, true);
                    rdview.alertViewBehavriour = (ab, view) => {
                        switch (ab)
                        {
                        case MDAlertBehaviour.CLICK_OK:
                            YeHuoSDK.YHPay(payKey, costMenoy, 0, (succecc) => {
                                view.hiddenView();
                                if (succecc)
                                {
                                    rdview.GetAllReward();
                                    WGGameUIView.Instance.freshSkillNum();
                                    WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN | UI_FRESH.COIN);
                                }
                            });
                            break;

                        case MDAlertBehaviour.CLICK_CANCEL:
                            view.hiddenView();
                            break;

                        case MDAlertBehaviour.DID_HIDDEN:
                            Destroy(view.gameObject);
                            WGAlertManager.Self.bBuySKill = false;
                            WGAlertManager.Self.RemoveHead();
                            WGAlertManager.Self.ShowNext();
                            Time.timeScale = 1;

                            break;
                        }
                    };
                    Time.timeScale = 0;
                    rdview.showView();
                    BCSoundPlayer.Play(MusicEnum.showReward, 1f);
                });

                WGAlertManager.Self.ShowNext();
            }
        }
    }
Esempio n. 3
0
    void showBuyPowerView()
    {
        WGDataController _dataCtrl = WGDataController.Instance;
        YHMDPayData      payData   = _dataCtrl.getYHMDPay(YHPayType.POWER);
        float            costMenoy = payData.payCost;
        string           payKey    = payData.payKey.ToString();
//		string paykey = "112";
//		float costMenoy = 30f;
//		if(YeHuoSDK.bUsePayCode2)
//		{
//			paykey = "212";
//			costMenoy = 20f;
//		}

        string okString = "ok";

                #if YES_OK
        string content = WGStrings.getFormateInt(1081, 1002, 8209, costMenoy.ToString());
        okString = WGStrings.getText(1002);
                #elif YES_BUY
        string content = WGStrings.getFormateInt(1081, 1094, 8209, costMenoy.ToString());
        okString = WGStrings.getText(1094);
#elif YES_GET
        string content = WGStrings.getFormateInt(1081, 1077, 8209, costMenoy.ToString());
        okString = WGStrings.getText(1077);
                #elif YES_QueRen
        string content = WGStrings.getFormateInt(1081, 1106, payData.showText, costMenoy.ToString());
        okString = WGStrings.getText(1106);
                #else
        string content = WGStrings.getFormateInt(1081, 1077, payData.showText, costMenoy.ToString());
        okString = WGStrings.getText(1077);
                #endif

        D04PowerBuyView bv = D04PowerBuyView.CreatePowerBuyView();
        bv.FreshUI(content, okString);
        bv.alertViewBehavriour = (ab, view) => {
            switch (ab)
            {
            case MDAlertBehaviour.CLICK_OK:
                YeHuoSDK.YHPay(payKey, costMenoy, 0, (success) => {
                    view.hiddenView();
                    if (success)
                    {
                        _dataPlayer.a1 = 1;
                        _bShowPowerTip = false;
                    }
                });
                break;

            case MDAlertBehaviour.CLICK_CANCEL:
                _dataPlayer.mEnergy -= _EnergyFull;
                view.hiddenView();
                break;

            case MDAlertBehaviour.DID_HIDDEN:
                Destroy(view.gameObject);
                _bShowPowerTip = false;
                Time.timeScale = 1;
                break;
            }
        };
        bv.showView();
    }
Esempio n. 4
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);
    }
Esempio n. 5
0
    void OnBtnTigerWithRMB()
    {
        YHMDPayData payData   = WGDataController.Instance.getYHMDPay(YHPayType.TIGER10);
        float       costMenoy = payData.payCost;
        string      payKey    = payData.payKey.ToString();
//		float costMenoy = 30;
//		string payKey = "113";
//		if(YeHuoSDK.bUsePayCode2)
//		{
//			costMenoy = 20;
//			payKey = "213";
//		}

        string okString = "ok";

                #if YES_OK
        string content = WGStrings.getFormateInt(1081, 1002, 8208, costMenoy.ToString());
        okString = WGStrings.getText(1002);
                #elif YES_BUY
        string content = WGStrings.getFormateInt(1081, 1094, 8208, costMenoy.ToString());
        okString = WGStrings.getText(1094);
#elif YES_GET
        string content = WGStrings.getFormateInt(1081, 1077, 8208, costMenoy.ToString());
        okString = WGStrings.getText(1077);
#elif YES_QueRen
        string content = WGStrings.getFormateInt(1081, 1106, payData.showText, costMenoy.ToString());
        okString = WGStrings.getText(1106);
                #else
        string content = WGStrings.getFormateInt(1081, 1077, payData.showText, costMenoy.ToString());
        okString = WGStrings.getText(1077);
                #endif

        mTiger.ESetActive(false);
        D04Buy10TigerView tView = D04Buy10TigerView.CreateBuy10TigerView();
        tView.FreshUI(payData.showText, content, okString);

        tView.alertViewBehavriour = (ab, view) => {
            switch (ab)
            {
            case MDAlertBehaviour.CLICK_OK:
                YeHuoSDK.YHPay(payKey, costMenoy, 0, (success) => {
                    view.hiddenView();
                    if (success)
                    {
                        mTiger.StartTiger(10);
                    }
                });
                break;

            case MDAlertBehaviour.CLICK_CANCEL:
                view.hiddenView();
                break;

            case MDAlertBehaviour.DID_HIDDEN:
                Destroy(view.gameObject);
                mTiger.ESetActive(true);
                break;
            }
        };
        tView.showView();
    }
Esempio n. 6
0
    void OnBtnChaoZhi()
    {
        if (!_DataPlayer.szBigReward.Contains(4))
        {
            WGAlertManager.Self.AddAction(() => {
                WGDataController _dataCtrl = WGDataController.Instance;
                YHMDPayData payData        = _dataCtrl.getYHMDPay(YHPayType.CHEAP);
                float costMenoy            = payData.payCost;
                string payKey = payData.payKey.ToString();
//#if Unicom
//				float costMenoy = 1f;
//#else
//				float costMenoy = 0.1f;
//#endif

//				string payKey = "104";
//				if(YeHuoSDK.bUsePayCode2)
//				{
//					payKey = "204";
//				}

                YHGotRewardView rdview = YHGotRewardView.CreateGotRewardView();
                rdview.mRType          = YHRewardType.Cheap;
                SDK.AddChild(rdview.gameObject, WGRootManager.Self.goRootTopUI);

                rdview.FreshRewardCell(_dataCtrl.mAllReward.cheap);
#if YES_OK
                string content = WGStrings.getFormateInt(1081, 1002, 1086, costMenoy.ToString());
#elif YES_BUY
                string content = WGStrings.getFormateInt(1081, 1094, 1086, costMenoy.ToString());
#elif YES_GET
                string content = WGStrings.getFormateInt(1081, 1077, 1086, costMenoy.ToString());
#elif YES_QueRen
                string content = WGStrings.getFormateInt(1081, 1106, payData.showText, costMenoy.ToString());
#else
                string content = WGStrings.getFormateInt(1081, 1077, payData.showText, costMenoy.ToString());
#endif
                rdview.FreshWithMsg(payData.showText, content, true, true);
                rdview.alertViewBehavriour = (ab, view) => {
                    switch (ab)
                    {
                    case MDAlertBehaviour.CLICK_OK:
                        {
                            YeHuoSDK.YHPay(payKey, costMenoy, 0, (success) => {
                                view.hiddenView();
                                if (success)
                                {
                                    btnChaoZhi.ESetActive(false);

                                    _DataPlayer.szBigReward.Add(4);

                                    rdview.GetAllReward();
                                    WGGameUIView.Instance.freshSkillNum();
                                    WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN | UI_FRESH.COIN);
                                }
                            });
                        }
                        break;

                    case MDAlertBehaviour.CLICK_CANCEL:
                        view.hiddenView();
                        break;

                    case MDAlertBehaviour.DID_HIDDEN:

                        Destroy(view.gameObject);
                        WGAlertManager.Self.RemoveHead();
                        WGAlertManager.Self.ShowNext();
                        break;
                    }
                };
                rdview.showView();
                BCSoundPlayer.Play(MusicEnum.showReward, 1f);
            });

            WGAlertManager.Self.ShowNext();
        }
    }