示例#1
0
    public MDSkill getSkill(int id)
    {
        MDSkill sk = null;

        dicSkills.TryGetValue(id, out sk);
        return(sk);
    }
示例#2
0
    int GetRandomID()
    {
//		return 9;

        DataPlayer _dp = DataPlayerController.getInstance().data;



        int maxWeight = _AllTigerWeight;

        if (_dp.up777Time > 0)
        {
            MDSkill sk = WGDataController.Instance.getSkill(WGDefine.SK_777Up1);
            maxWeight = _AllTigerWeight + sk.paramater.toInt();
        }
        if (WGHelpManager.Self != null && WGHelpManager.Self.enabled)
        {
            if (!WGHelpManager.Self.StatesIsEnd(EMHelpStates.Tiger_777))
            {
                maxWeight += 90000;
            }
        }

        int weight = Random.Range(0, maxWeight);

        for (int i = 0, max = _TigerWeightList.Count; i < max; i++)
        {
            if (_TigerWeightList[i] >= weight)
            {
                return(i);
            }
        }

        return(_777Index);       //如果没有则返回[7,7,7]
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        MDSkill sk2003 = WGDataController.Instance.getSkill(WGDefine.SK_ChangShe100);
        MDSkill sk2005 = WGDataController.Instance.getSkill(WGDefine.SK_FangYu4);
        MDSkill sk2007 = WGDataController.Instance.getSkill(WGDefine.SK_DiZhen);
        MDSkill sk2008 = WGDataController.Instance.getSkill(WGDefine.SK_JianSu);

        labDes2003.text = sk2003.des;
        labDes2005.text = sk2005.des;
        labDes2007.text = sk2007.des;
        labDes2008.text = sk2008.des;
    }
示例#4
0
    public void ShowSkillEffectWithSKid(int skid)
    {
        goContent.ESetActive(true);
        MDSkill sk = WGDataController.Instance.getSkill(skid);

        spSkillIcon.spriteName = sk.icon;
        labSkillDes.text       = WGStrings.getFormate(1600, sk.name);

        CancelInvoke("LeftEffect");
        CancelInvoke("HiddenSkillEffect");
        mLeftCount  = 3;
        mRightCount = 3;
        InvokeRepeating("LeftEffect", 0.1f, 0.3f);
        Invoke("HiddenSkillEffect", 2.5f);
    }
示例#5
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();
            }
        }
    }
示例#6
0
    public void ReleaseSkillWithID(int id)
    {
        DataPlayer _dp = DataPlayerController.getInstance().data;

        MDSkill sk = WGDataController.Instance.getSkill(id);

        //Debug.Log("SkillId:"+id);
        switch (id)
        {
        case WGDefine.SK_YunShi:
            WGGameWorld.Instance.BearCoinShaking(sk.time, WGDefine.SK_YunShi);
            break;

        case WGDefine.SK_ChangShe50:
            WGBearManage.Instance.Long50();
            break;

        case WGDefine.SK_ChangShe100:
            BCSoundPlayer.Play(MusicEnum.daoju4);
            WGBearManage.Instance.Long100();
            break;

        case WGDefine.SK_FangYu1:
            WGBearManage.Instance.BearTreeUp(sk.time, true);
            break;

        case WGDefine.SK_FangYu4:
            BCSoundPlayer.Play(MusicEnum.daoju3);
            WGBearManage.Instance.BearTreeUp(sk.time);
            break;

        case WGDefine.SK_BingXue:
            WGBearManage.Instance.ChangeTableMoca();
            break;

        case WGDefine.SK_DiZhen:
            BCSoundPlayer.Play(MusicEnum.daoju2);
            WGGameWorld.Instance.BearCoinShaking(sk.time, WGDefine.SK_DiZhen);
            break;

        case WGDefine.SK_JianSu:
            BCSoundPlayer.Play(MusicEnum.daoju1);
            WGBearManage.Instance.DecelerationTurn(sk.time);
            break;

        case WGDefine.SK_HaiXiao:
            WGBearManage.Instance.DonNotNeedCoin(sk.time);
            break;

        case WGDefine.SK_Defense10M:
        case WGDefine.SK_Defense30M:
            WGBearManage.Instance.BearTreeUp(sk.time, true);
            break;

        case WGDefine.SK_777Up1:

            break;

        case WGDefine.SK_777Up2:

            break;

        case WGDefine.SK_GuDing30:

            WGBearManage.Instance.csThrow.CheckStaticWeapon();
            break;

        case WGDefine.SK_GuDing:

            WGBearManage.Instance.csThrow.CheckStaticWeapon();
            break;
        }
    }
示例#7
0
    void OnBtnBuy()
    {
        char [] spliter = { ',', '.', ',', '。' };
        BCSoundPlayer.Play(MusicEnum.button);
        DataPlayerController dpc = DataPlayerController.getInstance();
        DataPlayer           _dp = dpc.data;

        if (mData.type == MDShopData.JEWEL)
        {
#if Umeng
            var dict = new Dictionary <string, string>();
            dict["costNum"] = mData.cost_num.ToString();
            dict["getNum"]  = mData.get_num.ToString();
            Umeng.GA.Event(UmengKey.ClickPay, dict);
#endif

//			#if TalkingData
//			//TDGAItem.OnPurchase("钻石"+mData.get_num.ToString(),1,mData.cost_num);
//			Dictionary<string, object> dic = new Dictionary<string, object>();
//			dic.Add("JewelNum",mData.get_num.ToString());
//			TalkingDataGA.OnEvent("购买钻石",dic);
//			#endif

            WGProductController.instance.OnBuyWithMDShopData(mData);
        }
        else if (mData.type == MDShopData.COIN)
        {
            if (_dp.Jewel >= mData.cost_num)
            {
#if Umeng
                var dict = new Dictionary <string, string>();
                dict["coin"] = mData.sid.ToString();
                Umeng.GA.Event(UmengKey.ClickBuy, dict);
#endif
                string title = WGStrings.getFormate(1030, mData.get_num.ToString(), mData.cost_num.ToString());
                WGAlertViewController.Self.showAlertView(title, 1002, 1007).alertViewBehavriour = (ab, view) => {
                    switch (ab)
                    {
                    case MDAlertBehaviour.CLICK_OK:
                    {
#if Umeng
                        Umeng.GA.Buy(mData.id.ToString(), mData.get_num, mData.cost_num * 1.0f / mData.get_num);
                        Umeng.GA.Event(UmengKey.BuySuccess, dict);
#endif
#if TalkingData
                        TDGAItem.OnPurchase("金币_" + mData.get_num.ToString(), 1, mData.cost_num);
                        Dictionary <string, object> dic = new Dictionary <string, object>();
                        dic.Add("CoinNum", mData.get_num.ToString());
                        TalkingDataGA.OnEvent("购买金币", dic);
#endif
                        _dp.Coin  += mData.get_num;
                        _dp.Jewel -= mData.cost_num;
                        DataPlayerController.getInstance().saveDataPlayer();
                        WGGameUIView.Instance.freshPlayerUI(UI_FRESH.COIN | UI_FRESH.BCOIN);

                        view.hiddenView();

                        WGAlertViewController.Self.showTipView(1001);

//							WGAlertViewController.Self.showAlertView(1001).alertViewBehavriour =(ab1,view1) => {
//								switch(ab1)
//								{
//								case MDAlertBehaviour.CLICK_OK:
//									view.hiddenView();
//									break;
//								case MDAlertBehaviour.DID_HIDDEN:
//									WGAlertViewController.Self.hiddeAlertView(view1.gameObject);
//									break;
//								}
//							};
                        break;
                    }

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

                    case MDAlertBehaviour.DID_HIDDEN:
                        WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                        break;
                    }
                };
            }
            else
            {
                WGAlertViewController.Self.showAlertView(1003, 1002, 1007).alertViewBehavriour = (ab, view) => {
                    switch (ab)
                    {
                    case MDAlertBehaviour.CLICK_OK:
                        view.hiddenView();
                        WGShopView.curShopView.InitWillShowWithTabView(SHOP_TAB_VIEW.JEWEL_SHOP);
                        break;

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

                    case MDAlertBehaviour.DID_HIDDEN:
                        WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                        break;
                    }
                };
            }
        }
        else if (mData.type == MDShopData.ITEM)
        {
            if ((mData.cost_type == 1 && _dp.Jewel >= mData.cost_num) || (mData.cost_type == 0 && _dp.Coin >= mData.cost_num))
            {
                var dict = new Dictionary <string, string>();
                dict["item"] = mData.sid.ToString();
#if Umeng
                Umeng.GA.Event(UmengKey.ClickBuy, dict);
#endif
                if (mData.id == WGDefine.SK_Defense10M || mData.id == WGDefine.SK_Defense30M)
                {
                    if (_dp.defenseTime > 0)
                    {
                        return;
                    }

                    MDSkill sk      = WGDataController.Instance.getSkill(mData.id);
                    int     titleID = mData.cost_type == 0?7006:1006;
                    string  title   = WGStrings.getFormate(titleID, sk.time.ToString(), mData.cost_num.ToString());
                    WGAlertViewController.Self.showAlertView(title, 1002, 1007).alertViewBehavriour = (ab, view) => {
                        switch (ab)
                        {
                        case MDAlertBehaviour.CLICK_OK:
                        {
                            string msg = "";
                            if (_dp.defenseTime > 0)
                            {
                                msg = WGStrings.getFormate(1008, _dp.defenseTime);
                            }
                            else
                            {
                                msg = WGStrings.getText(1001);
                                if (mData.cost_type == 1)
                                {
                                    _dp.Jewel -= mData.cost_num;
#if TalkingData
                                    string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                    TDGAItem.OnPurchase(name, 1, mData.cost_num);

                                    TDGAItem.OnUse(name, 1);
                                    Dictionary <string, object> dic = new Dictionary <string, object>();
                                    dic.Add("item", name);
                                    TalkingDataGA.OnEvent("购买道具", dic);
#endif
#if Umeng
                                    Umeng.GA.Buy(mData.id.ToString(), mData.get_num, mData.cost_num * 1.0f / mData.get_num);
#endif
                                }
                                else if (mData.cost_type == 0)
                                {
                                                                                #if TalkingData
                                    string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                    Dictionary <string, object> dic1 = new Dictionary <string, object>();
                                    dic1.Add("item", name);
                                    TalkingDataGA.OnEvent("金币购买道具", dic1);
                                                                                #endif
                                    _dp.Coin -= mData.cost_num;
                                }
#if Umeng
                                Umeng.GA.Event(UmengKey.BuySuccess, dict);
#endif
                                WGGameUIView.Instance.freshPlayerUI(UI_FRESH.COIN | UI_FRESH.BCOIN);
                                WGGameUIView.Instance.freshSkillNum();

                                _dp.defenseTime = _dp.defenseTime + (int)sk.time;
                                WGSkillController.Instance.ReleaseSkillWithID(mData.id);
                                GetTimeCount(mData);
                                showTimeCount();

                                WGShopView.curShopView.mTableView.UpdataCells();
//									node.refresh();
                            }
                            view.hiddenView();
                            WGAlertViewController.Self.showTipView(msg);
//								WGAlertViewController.Self.showAlertView(msg).alertViewBehavriour =(ab1,view1) => {
//									switch(ab1)
//									{
//									case MDAlertBehaviour.CLICK_OK:
//										view1.hiddenView();
//										break;
//									case MDAlertBehaviour.DID_HIDDEN:
//										WGAlertViewController.Self.hiddeAlertView(view1.gameObject);
//										break;
//									}
//								};
                            break;
                        }

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

                        case MDAlertBehaviour.DID_HIDDEN:
                            WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                            break;
                        }
                    };
                }
                else if (mData.id == WGDefine.SK_777Up1 || mData.id == WGDefine.SK_777Up2)
                {
                    if (_dp.up777Time > 0)
                    {
                        return;
                    }
                    MDSkill sk      = WGDataController.Instance.getSkill(mData.id);
                    int     titleID = mData.cost_type == 0?7009:1009;
                    string  title   = WGStrings.getFormate(titleID, sk.time.ToString(), mData.cost_num.ToString());

                    WGAlertViewController.Self.showAlertView(title, 1002, 1007).alertViewBehavriour = (ab, view) => {
                        switch (ab)
                        {
                        case MDAlertBehaviour.CLICK_OK:
                        {
                            string msg = "";
                            if (_dp.up777Time > 0)
                            {
                                msg = WGStrings.getFormate(1010, _dp.defenseTime);
                            }
                            else
                            {
                                msg = WGStrings.getText(1001);

                                if (mData.cost_type == 1)
                                {
                                    _dp.Jewel -= mData.cost_num;

#if TalkingData
                                    TDGAItem.OnPurchase("道具_" + mData.pdes.Split(spliter)[0] + mData.des, 1, mData.cost_num);

                                    TDGAItem.OnUse("道具_" + mData.pdes.Split(spliter)[0] + mData.des, 1);

                                    Dictionary <string, object> dic = new Dictionary <string, object>();
                                    dic.Add("item", name);
                                    TalkingDataGA.OnEvent("购买道具", dic);
#endif
#if Umeng
                                    Umeng.GA.Buy(mData.id.ToString(), mData.get_num, mData.cost_num * 1.0f / mData.get_num);
#endif
                                }
                                else if (mData.cost_type == 0)
                                {
                                                                                #if TalkingData
                                    string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                    Dictionary <string, object> dic1 = new Dictionary <string, object>();
                                    dic1.Add("item", name);
                                    TalkingDataGA.OnEvent("金币购买道具", dic1);
                                                                                #endif
                                    _dp.Coin -= mData.cost_num;
                                }
#if Umeng
                                Umeng.GA.Event(UmengKey.BuySuccess, dict);
#endif
                                WGGameUIView.Instance.freshPlayerUI(UI_FRESH.COIN | UI_FRESH.BCOIN);
                                WGGameUIView.Instance.freshSkillNum();

                                _dp.up777Time = _dp.up777Time + (int)sk.time;
                                WGSkillController.Instance.ReleaseSkillWithID(mData.id);

                                GetTimeCount(mData);
                                showTimeCount();
//									WGGameUIView.Instance.mShopView.mTableView.UpdataCells();
                                WGShopView.curShopView.mTableView.UpdataCells();
//									node.refresh();
                            }
                            view.hiddenView();
                            WGAlertViewController.Self.showTipView(msg);
//								WGAlertViewController.Self.showAlertView(msg).alertViewBehavriour =(ab1,view1) => {
//									switch(ab1)
//									{
//									case MDAlertBehaviour.CLICK_OK:
//										view1.hiddenView();
//										break;
//									case MDAlertBehaviour.DID_HIDDEN:
//										WGAlertViewController.Self.hiddeAlertView(view1.gameObject);
//										break;
//									}
//								};
                            break;
                        }

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

                        case MDAlertBehaviour.DID_HIDDEN:
                            WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                            break;
                        }
                    };
                }
                else if (mData.id == WGDefine.SK_GuDing30)
                {
                    if (_dp.guDingTime > 0)
                    {
                        return;
                    }
                    if (_dp.guDingForever > 0)
                    {
                        WGAlertViewController.Self.showAlertView(1033).alertViewBehavriour = (ab, view) => {
                            switch (ab)
                            {
                            case MDAlertBehaviour.CLICK_OK:
                                view.hiddenView();
                                break;

                            case MDAlertBehaviour.DID_HIDDEN:
                                WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                                break;
                            }
                        };
                        return;
                    }
                    MDSkill sk    = WGDataController.Instance.getSkill(mData.id);
                    string  title = WGStrings.getFormate(1019, sk.time.ToString(), mData.cost_num.ToString());
                    WGAlertViewController.Self.showAlertView(title, 1002, 1007).alertViewBehavriour = (ab, view) => {
                        switch (ab)
                        {
                        case MDAlertBehaviour.CLICK_OK:
                        {
                            string msg = "";

                            msg = WGStrings.getText(1001);

                            if (mData.cost_type == 1)
                            {
                                _dp.Jewel -= mData.cost_num;
#if TalkingData
                                string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                TDGAItem.OnPurchase(name, 1, mData.cost_num);

                                TDGAItem.OnUse(name, 1);
                                Dictionary <string, object> dic = new Dictionary <string, object>();
                                dic.Add("item", name);
                                TalkingDataGA.OnEvent("购买道具", dic);
#endif
#if Umeng
                                Umeng.GA.Buy(mData.id.ToString(), mData.get_num, mData.cost_num * 1.0f / mData.get_num);
#endif
                            }
                            else if (mData.cost_type == 0)
                            {
                                                                        #if TalkingData
                                string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                Dictionary <string, object> dic1 = new Dictionary <string, object>();
                                dic1.Add("item", name);
                                TalkingDataGA.OnEvent("金币购买道具", dic1);
                                                                        #endif
                                _dp.Coin -= mData.cost_num;
                            }
#if Umeng
                            Umeng.GA.Event(UmengKey.BuySuccess, dict);
#endif
                            _dp.guDingTime = (int)sk.time;

                            WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN);
                            WGGameUIView.Instance.freshSkillNum();
                            GetTimeCount(mData);
                            showTimeCount();

                            _dp.releaseGuding = 1;
                            WGSkillController.Instance.ReleaseSkillWithID(WGDefine.SK_GuDing30);
                            view.hiddenView();
                            WGAlertViewController.Self.showTipView(1001);

                            break;
                        }

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

                        case MDAlertBehaviour.DID_HIDDEN:
                            WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                            break;
                        }
                    };
                }
                else if (mData.id == WGDefine.SK_GuDing)
                {
                    if (_dp.guDingForever > 0)
                    {
//						WGSkillController.Instance.ReleaseSkillWithID(mData.id);
//						GetTimeCount(mData);
                    }
                    else
                    {
                        MDSkill sk    = WGDataController.Instance.getSkill(mData.id);
                        string  title = WGStrings.getFormate(1020, mData.cost_num.ToString());
                        WGAlertViewController.Self.showAlertView(title, 1002, 1007).alertViewBehavriour = (ab, view) => {
                            switch (ab)
                            {
                            case MDAlertBehaviour.CLICK_OK:
                            {
                                string msg = "";
                                if (_dp.guDingForever > 0)
                                {
                                    msg = WGStrings.getText(1022);
                                }
                                else
                                {
                                    msg = WGStrings.getText(1001);

                                    if (mData.cost_type == 1)
                                    {
                                        _dp.Jewel -= mData.cost_num;

#if TalkingData
                                        string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                        TDGAItem.OnPurchase(name, 1, mData.cost_num);
                                        TDGAItem.OnUse(name, 1);
                                        Dictionary <string, object> dic = new Dictionary <string, object>();
                                        dic.Add("item", name);
                                        TalkingDataGA.OnEvent("购买道具", dic);
#endif

#if Umeng
                                        Umeng.GA.Buy(mData.id.ToString(), mData.get_num, mData.cost_num * 1.0f / mData.get_num);
#endif
                                    }
                                    else if (mData.cost_type == 0)
                                    {
                                                                                        #if TalkingData
                                        string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                        Dictionary <string, object> dic1 = new Dictionary <string, object>();
                                        dic1.Add("item", name);
                                        TalkingDataGA.OnEvent("金币购买道具", dic1);
                                                                                        #endif
                                        _dp.Coin -= mData.cost_num;
                                    }
#if Umeng
                                    Umeng.GA.Event(UmengKey.BuySuccess, dict);
#endif
                                    _dp.guDingForever = 1;

                                    WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN);
                                    WGGameUIView.Instance.freshSkillNum();

                                    WGSkillController.Instance.ReleaseSkillWithID(mData.id);

                                    GetTimeCount(mData);
                                    showTimeCount();
                                }
                                view.hiddenView();
                                WGAlertViewController.Self.showTipView(msg);

//									WGAlertViewController.Self.showAlertView(msg).alertViewBehavriour =(ab1,view1) => {
//										switch(ab1)
//										{
//										case MDAlertBehaviour.CLICK_OK:
//											view1.hiddenView();
//											break;
//										case MDAlertBehaviour.DID_HIDDEN:
//											WGAlertViewController.Self.hiddeAlertView(view1.gameObject);
//											break;
//										}
//									};
                                break;
                            }

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

                            case MDAlertBehaviour.DID_HIDDEN:
                                WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                                break;
                            }
                        };
                    }
                }
                else
                {
                    MDSkill sk      = WGDataController.Instance.getSkill(mData.id);
                    int     titleID = mData.cost_type == 0?7029:1029;
                    string  title   = WGStrings.getFormate(titleID, mData.get_num.ToString(), sk.name, mData.cost_num.ToString());
                    WGAlertViewController.Self.showAlertView(title, 1002, 1007).alertViewBehavriour = (ab, view) => {
                        switch (ab)
                        {
                        case MDAlertBehaviour.CLICK_OK:
                        {
                            dpc.AddSkillNum(mData.id, mData.get_num);
                            if (mData.cost_type == 1)
                            {
                                _dp.Jewel -= mData.cost_num;
                                                                #if TalkingData
                                string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                TDGAItem.OnPurchase(name, 1, mData.cost_num);
                                Dictionary <string, object> dic = new Dictionary <string, object>();
                                //dic.Add("name",sk.name);
                                dic.Add("item", name);
                                TalkingDataGA.OnEvent("购买道具", dic);
                                                                #endif
#if Umeng
                                Umeng.GA.Buy(mData.id.ToString(), mData.get_num, mData.cost_num * 1.0f / mData.get_num);
#endif
                            }
                            else if (mData.cost_type == 0)
                            {
                                                                        #if TalkingData
                                string name = "道具_" + mData.pdes.Split(spliter)[0] + mData.des;
                                Dictionary <string, object> dic1 = new Dictionary <string, object>();
                                dic1.Add("item", name);
                                TalkingDataGA.OnEvent("金币购买道具", dic1);
                                                                        #endif
                                _dp.Coin -= mData.cost_num;
                            }
#if Umeng
                            Umeng.GA.Event(UmengKey.BuySuccess, dict);
#endif
                            WGGameUIView.Instance.freshPlayerUI(UI_FRESH.COIN | UI_FRESH.BCOIN);
                            WGGameUIView.Instance.freshSkillNum();

                            view.hiddenView();
                            WGAlertViewController.Self.showTipView(1001);

//								WGAlertViewController.Self.showAlertView(1001).alertViewBehavriour =(ab1,view1) => {
//									switch(ab1)
//									{
//									case MDAlertBehaviour.CLICK_OK:
//										view1.hiddenView();
//										break;
//									case MDAlertBehaviour.DID_HIDDEN:
//										WGAlertViewController.Self.hiddeAlertView(view1.gameObject);
//										break;
//									}
//								};

                            break;
                        }

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

                        case MDAlertBehaviour.DID_HIDDEN:
                            WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                            break;
                        }
                    };
                }
            }
            else
            {
                int msgID = mData.cost_type == 0?7003:1003;
                WGAlertViewController.Self.showAlertView(msgID, 1002, 1007).alertViewBehavriour = (ab, view) => {
                    switch (ab)
                    {
                    case MDAlertBehaviour.CLICK_OK:
                        view.hiddenView();
                        if (mData.cost_type == 1)
                        {
                            WGShopView.curShopView.InitWillShowWithTabView(SHOP_TAB_VIEW.JEWEL_SHOP);
                        }
                        else if (mData.cost_type == 0)
                        {
                            WGShopView.curShopView.InitWillShowWithTabView(SHOP_TAB_VIEW.Coin_SHOP);
                        }
                        break;

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

                    case MDAlertBehaviour.DID_HIDDEN:
                        WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                        break;
                    }
                };
            }
        }
    }