示例#1
0
    public static D04Buy10TigerView CreateBuy10TigerView()
    {
        Object obj = Resources.Load("pbD04Buy10TigerView");

        GameObject go = Instantiate(obj) as GameObject;

        SDK.AddChild(go, WGRootManager.Self.goRootTopUI);

        D04Buy10TigerView drv = go.GetComponent <D04Buy10TigerView>();

        return(drv);
    }
示例#2
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();
    }