Exemplo n.º 1
0
    public void OnBuyDiamond(UILabel RMBNum)
    {
        Debug.Log("RMBNum is: " + RMBNum.text);
#if US_VERSION && UNITY_IPHONE
        switch (RMBNum.text)
        {
        case "0.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.ONE_TIER);
            break;

        case "4.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.FIVE_TIER);
            break;

        case "9.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.TEN_TIER);
            break;

        case "19.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.TWENTU_TIER);
            break;

        case "29.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.THIRTY_TIER);
            break;

        case "49.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.FIFTY_TIER);
            break;
        }
//#elif UNITY_ANDROID
//		switch(RMBNum.text)
//		{
//		case "2":
//			LoadingDialog.Popup();
//			MINIAnySDKManager.BuyItem(MINIAnySDKManager.B20);
//			break;
//		case "4":
//			LoadingDialog.Popup();
//			MINIAnySDKManager.BuyItem(MINIAnySDKManager.B45);
//			break;
//		case "8":
//			LoadingDialog.Popup();
//			MINIAnySDKManager.BuyItem(MINIAnySDKManager.B96);
//			break;
//		case "12":
//			LoadingDialog.Popup();
//			MINIAnySDKManager.BuyItem(MINIAnySDKManager.B155);
//			break;
//		case "30":
//			LoadingDialog.Popup();
//			MINIAnySDKManager.BuyItem(MINIAnySDKManager.B400);
//			break;
//		case "60":
//			LoadingDialog.Popup();
//			MINIAnySDKManager.BuyItem(MINIAnySDKManager.B1000);
//			break;
//		}
#else
        int RMB     = int.Parse(RMBNum.text);
        int diamond = 0;
        switch (RMB)
        {
        case 2:
            diamond = 20;
            break;

        case 4:
            diamond = 45;
            break;

        case 8:
            diamond = 96;
            break;

        case 12:
            diamond = 155;
            break;

        case 30:
            diamond = 400;
            break;

        case 60:
            diamond = 1000;
            break;
        }
        GameData.Instance.AddDiamond(diamond);
#endif
    }
Exemplo n.º 2
0
    public void OnBuyDiamond(UILabel RMBNum)
    {
        Debug.Log("RMBNum is: " + RMBNum.text);
#if US_VERSION && UNITY_IPHONE
        switch (RMBNum.text)
        {
        case "0.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.ONE_TIER);
            break;

        case "4.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.FIVE_TIER);
            break;

        case "9.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.TEN_TIER);
            break;

        case "19.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.TWENTU_TIER);
            break;

        case "29.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.THIRTY_TIER);
            break;

        case "49.99":
            LoadingDialog.Popup();
            MINIPaymentManager.buyItem(MINIPaymentManager.FIFTY_TIER);
            break;
        }
#else
        int RMB     = int.Parse(RMBNum.text);
        int diamond = 0;
        switch (RMB)
        {
        case 2:
            diamond = 20;
            break;

        case 4:
            diamond = 45;
            break;

        case 8:
            diamond = 96;
            break;

        case 12:
            diamond = 155;
            break;

        case 30:
            diamond = 400;
            break;

        case 60:
            diamond = 1000;
            break;
        }
        GameData.Instance.AddDiamond(diamond);
#endif
    }