Exemplo 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
    }
Exemplo n.º 2
0
 void OnGUI()
 {
     //Kinds of Buttons
     if (GUI.Button(getRectByNo(0), "Init"))
     {
         TBSDK.TBSetUseOldLoadingMode(isUseOldMode);
         isUseOldMode = !isUseOldMode;
         TBSDK.TBInit();
     }
     //Login
     if (GUI.Button(getRectByNo(1), "Login"))
     {
         TBSDK.TBLogin(0);
     }
     //Logout
     if (GUI.Button(getRectByNo(2), "Logout"))
     {
         TBSDK.TBLogout();
     }
     //SwitchAccount
     if (GUI.Button(getRectByNo(3), "SwitchAccount"))
     {
         TBSDK.TBSwitchAccount();
     }
     //isLogin
     if (GUI.Button(getRectByNo(4), "IsLogin"))
     {
         TBSDK.TBIsLogined();
     }
     //setDebug
     if (GUI.Button(getRectByNo(5), "SetDebug"))
     {
         TBSDK.TBSetDebug();
     }
     //SessionID
     if (GUI.Button(getRectByNo(6), "SessionID"))
     {
         TBSDK.TBSessionID();
     }
     //UserID
     if (GUI.Button(getRectByNo(7), "UserID"))
     {
         TBSDK.TBUserID();
     }
     //UserName
     if (GUI.Button(getRectByNo(8), "NickName"))
     {
         TBSDK.TBNickName();
     }
     //Pay50
     if (GUI.Button(getRectByNo(9), "Pay 50 rmb"))
     {
         TBSDK.TBPayRMB(50, "order here", "payDescription");
     }
     //Exchange
     if (GUI.Button(getRectByNo(10), "Exchange"))
     {
         TBSDK.TBExchange("order here", "payDescription");
     }
     //CheckOrder
     if (GUI.Button(getRectByNo(11), "CheckOrder"))
     {
         TBSDK.TBCheckOrder("orderhere");
     }
     //UserCenter
     if (GUI.Button(getRectByNo(12), "UserCenter"))
     {
         TBSDK.TBEnterUserCenter(0);
     }
     //GameRecommend
     if (GUI.Button(getRectByNo(13), "Recommendation"))
     {
         TBSDK.TBEnterAppCenter(0);
     }
     //BBS
     if (GUI.Button(getRectByNo(14), "BBS"))
     {
         TBSDK.TBEnterAppBBS(0);
     }
     //ShowToolBar
     if (GUI.Button(getRectByNo(15), "ShowToolBar"))
     {
         TBSDK.TBShowToolBar(3, true);
     }
     //HideToolBar
     if (GUI.Button(getRectByNo(16), "HideToolBar"))
     {
         TBSDK.TBHideToolBar();
     }
 }