Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        UILabel lab = this.GetComponent <UILabel>();

        if (lab != null)
        {
            lab.text = WGStrings.getText(textID);
        }
    }
Exemplo n.º 2
0
    public void freshUIWithData(MDAchievement ach)
    {
        preAchievementData = ach;

        WGDataController     _dataCtrl = WGDataController.Instance;
        DataPlayerController dpc       = DataPlayerController.getInstance();


        BCObj rwObj = _dataCtrl.GetBCObj(ach.reward[0]);

        labName.text = ach.name + ":" + ach.des;

        spGoalIcon.spriteName = ach.icon;
        switch (rwObj.BCType)
        {
        case BCGameObjectType.Coin:
            spRewardIcon.spriteName = "coin_105";
            break;

        case BCGameObjectType.Jewel:
            spRewardIcon.spriteName = "gem_104";
            break;
        }
        spRewardIcon.MakePixelPerfect();

        labRewardNum.text = WGStrings.getFormate(1066, ach.reward[1]);

        int got = 0;

        dpc.data.dicGotAchReward.TryGetValue(ach.id, out got);

        if (got == 1)     //到达了
        {
            btnGetReward.gameObject.SetActive(true);
            sdProgress.gameObject.SetActive(false);
            goHaveGot.SetActive(false);
        }
        else if (got == 0)       //还没有到达
        {
            goHaveGot.SetActive(false);
            btnGetReward.gameObject.SetActive(false);
            sdProgress.gameObject.SetActive(true);

            int reachNum = WGAchievementManager.Self.getAchievementProgress(ach);

            labProgress.text = reachNum.ToString() + "/" + ach.goal_num.ToString();
            sdProgress.value = reachNum * 1f / ach.goal_num;
        }
        else if (got == -1)       //已经领取
        {
            goHaveGot.SetActive(true);
            btnGetReward.gameObject.SetActive(false);
            sdProgress.gameObject.SetActive(false);
        }
    }
Exemplo n.º 3
0
    void viewDidLoad()
    {
        mTableView.csDelegate          = this;
        mTableView.f_WorldInScreenRate = 0.001760563f;

        int count = WGDataController.Instance.szShopData.Count;

        for (int i = 0; i < count; i++)
        {
            MDShopData sd = WGDataController.Instance.szShopData[i];
            if (sd.type == MDShopData.ITEM)
            {
                if (sd.id == WGDefine.SK_777Up1 || sd.id == WGDefine.SK_777Up2)
                {
                    if (YeHuoSDK.bCommonTiger)
                    {
                        szShopDataForSellItems.Add(sd);
                    }
                }
                else
                {
                    szShopDataForSellItems.Add(sd);
                }
            }
            else if (sd.type == MDShopData.COIN)
            {
                szShopDataForSellCoin.Add(sd);
            }
            else if (sd.type == MDShopData.JEWEL)
            {
                szShopDataForSellJewel.Add(sd);
            }
        }

        wpBtnCoin.title.text  = WGStrings.getText(1096);
        wpBtnItem.title.text  = WGStrings.getText(1095);
        wpBtnJewel.title.text = WGStrings.getText(1097);

        mState = SHOP_TAB_VIEW.ITEM_SHOP;

        szShopData              = szShopDataForSellItems;
        mDataCount              = szShopData.Count;
        mTableView.I_Hang       = 4;
        mTableView.f_TileHeight = 170;
        mTableView.fAddOffset   = 110;
        mTableView.AllReset();
        mTableView.reloadData();
        mIdentifier = 1;

        goItemView.SetActive(true);
        goCoinView.SetActive(false);
        goJewelView.SetActive(false);

        mTabView.InitState(wpBtnItem.button.transform.localPosition, wpBtnItem.title, goItemView);
    }
Exemplo n.º 4
0
    void InitView()
    {
        if (bInitView)
        {
            return;
        }
        bInitView = true;


        labTitle.text      = WGStrings.getText(8207);
        labContentDes.text = WGStrings.getText(1103);
    }
Exemplo n.º 5
0
    public void ShowMonsterWithID(int id, bool isGray = false)
    {
        mCurBearParam = _dataCtrl.GetBearParam(id);
        mCurBearID    = id;

        int cost = -mCurBearParam.unlock;

        labNeedJewel.text = cost.ToString();

        labNeedLevel.text = WGStrings.getFormate(1004, mCurBearParam.unlock);

        ShowOneBear.getInstance().ShowMonsterWithID(id, isGray);
    }
Exemplo n.º 6
0
 void OnBtnTigerWithJewel()
 {
     if (dp.Jewel < 12)
     {
         WGAlertViewController.Self.showTipView(WGStrings.getText(9010));
         //Debug.LogError("钻石不足");
     }
     else
     {
         dp.Jewel -= 12;
         mTiger.StartTiger();
     }
 }
Exemplo n.º 7
0
    public void FreshUI(string payTip, string ok, bool isFinger = false)
    {
        if (isFinger)
        {
            labTitle.text = WGStrings.getText(9009);
        }
        else
        {
            labTitle.text = WGStrings.getText(8209);
        }

        labPayTip.text  = payTip;
        labOkTitle.text = ok;
    }
Exemplo n.º 8
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);
    }
Exemplo n.º 9
0
    public void showNextPrefabs(int index)
    {
        bCanOk        = false;
        labTitle.text = WGStrings.getText(8000 + index);

        GameObject go  = Instantiate(szPrefabs[index]) as GameObject;
        UISprite   sp  = go.GetComponent <UISprite>();
        Vector3    pos = go.transform.localPosition;

        SDK.AddChild(go, tsContent.gameObject);
        go.transform.localPosition = pos;
        topWidget.SetAnchor(go);
        butWidget.SetAnchor(go);

        labBtnTitle.color     = Color.gray;
        spBtnBackground.color = Color.gray;
    }
Exemplo n.º 10
0
    void showNextPrefabs()
    {
        labTitle.text = WGStrings.getText(8000 + showIndex);

        GameObject go  = Instantiate(szPrefabs[showIndex]) as GameObject;
        UISprite   sp  = go.GetComponent <UISprite>();
        Vector3    pos = go.transform.localPosition;

        SDK.AddChild(go, tsContent.gameObject);
        go.transform.localPosition = pos;
        topWidget.SetAnchor(go);
        butWidget.SetAnchor(go);
        if (goCurHelp != null)
        {
            Destroy(goCurHelp);
        }
        goCurHelp = go;
    }
Exemplo n.º 11
0
    public override void showView()
    {
        base.showView();
        if (string.IsNullOrEmpty(YeHuoSDK.Self.mUserID))
        {
            labUserID.text = "";
        }
        else
        {
            labUserID.text = WGStrings.getText(1107) + YeHuoSDK.Self.mUserID;
        }

        spBackground.ESetActive(true);
        tsContent.ESetActive(true);
        tsContent.PlayForward();
        InvokeBlock(tsContent.duration, () => {
            showViewEnd();
        });
    }
Exemplo n.º 12
0
    void TimeCount()
    {
        mTimeCount--;

        if (labTimeCount != null)
        {
            if (mTimeCount <= 0)
            {
                GetTimeCount(mData);
            }
            int mSecond = mTimeCount % 60;
            int mMinute = mTimeCount / 60;
            labTimeCount.text = WGStrings.getText(1046) + "00:" + mMinute.ToString("00") + ":" + mSecond.ToString("00");
            if (mTimeCount <= 0)
            {
                showTimeCount();
            }
        }
    }
Exemplo n.º 13
0
    void freshSellView()
    {
        mGotCoin = 0;
        if (col1 != null)
        {
            mGotCoin += col1.sell_num * col1.sell_factor * mSellCount;
        }
        if (col2 != null)
        {
            mGotCoin += col2.sell_num * col2.sell_factor * mSellCount;
        }
        if (col3 != null)
        {
            mGotCoin += col3.sell_num * col3.sell_factor * mSellCount;
        }
        int got = Mathf.CeilToInt(mGotCoin + 0.5f);

        labSellNum.text    = mSellCount.ToString();
        labGetCoinNum.text = WGStrings.getFormate(1049, got);
        labTotalNum.text   = WGStrings.getFormate(1048, maxCount);
    }
Exemplo n.º 14
0
    void GetTimeCount(MDShopData data)
    {
        DataPlayerController dpc = DataPlayerController.getInstance();

        switch (data.id)
        {
        case WGDefine.SK_777Up1:
        case WGDefine.SK_777Up2:
            mTimeCount = dpc.data.up777Time;
            break;

        case WGDefine.SK_Defense10M:
        case WGDefine.SK_Defense30M:
            mTimeCount = dpc.data.defenseTime;

            break;

        case WGDefine.SK_GuDing30:
            mTimeCount = dpc.data.guDingTime;
            break;

        case WGDefine.SK_GuDing:
            mTimeCount     = dpc.data.guDingForever;
            mySwitch.value = dpc.data.releaseGuding > 0;
            break;

        default:
            mTimeCount = 0;
            break;
        }

        if (data.id != WGDefine.SK_GuDing && mTimeCount > 0 && labTimeCount != null)
        {
            int mSecond = mTimeCount % 60;
            int mMinute = mTimeCount / 60;
            labTimeCount.text = WGStrings.getText(1046) + "00:" + mMinute.ToString("00") + ":" + mSecond.ToString("00");
        }
    }
Exemplo n.º 15
0
 // Use this for initialization
 void Start()
 {
     labTrue.text  = WGStrings.getText(1092);
     labFalse.text = WGStrings.getText(1093);
 }
Exemplo n.º 16
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();
    }
Exemplo n.º 17
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);
    }
Exemplo n.º 18
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();
    }
Exemplo n.º 19
0
    public void ShowHelpView(EMHelpStates hs)
    {
        bViewShow = true;

        curGuideView = WGGuideHelpView.CreateGuideView();
        curGuideView.showNextPrefabs((int)hs);
        StatesEnd(hs);

        int p = 0;

        for (int i = 0; i < max; i++)
        {
            if (dp.dicHelp.ContainsKey(i) && dp.dicHelp[i] == 1)
            {
                p++;
            }
        }
        if (p == max)
        {
            dp.mHelpEnd  = 1;
            this.enabled = false;
        }
        string missionName = WGStrings.getText(8100 + (int)hs);

        //Debug.Log("==============="+missionName);
                #if TalkingData
        TDGAMission.OnBegin(missionName);
                #endif
#if Umeng
        var dict = new Dictionary <string, string>();
        dict.Add("states", hs.ToString());

        Umeng.GA.Event(UmengKey.UserHelp, dict);
#endif
        SDK.AddChild(curGuideView.gameObject, go2DRoot);
        curGuideView.ESetActive(true);
        curGuideView.showView();
        if (hs == EMHelpStates.Use_Item)
        {
            curGuideView.hideBtnOK();
            UIEventListener.Get(WGGameUIView.Instance.mMainMenuView.btnGuide).onClick = (GameObject obj) => curGuideView.OnBtnOk();
            WGGameUIView.Instance.mMainMenuView.hightLightBtnSkill4();
        }
        if (hs == EMHelpStates.Use_Weapon)
        {
            curGuideView.hideBtnOK();
            UIEventListener.Get(WGGameUIView.Instance.mMainMenuView.btnGuide).onClick = (GameObject obj) => curGuideView.OnBtnOk();
            //curGuideView.setBtnOKPos(WGGameUIView.Instance.mMainMenuView.btnAdd.transform.position);
            WGGameUIView.Instance.mMainMenuView.hightLightBtnAdd();
        }
        curGuideView.alertViewBehavriour = (ab, view) => {
            switch (ab)
            {
            case MDAlertBehaviour.CLICK_OK:
                if (hs == EMHelpStates.Free10_Skill)
                {
                    dp.guDingTime    = 10 * 60;
                    dp.releaseGuding = 1;
                    WGSkillController.Instance.ReleaseSkillWithID(WGDefine.SK_GuDing30);
                    WGAlertViewController.Self.showAlertView(1068).alertViewBehavriour = (ab1, view1) => {
                        switch (ab1)
                        {
                        case MDAlertBehaviour.CLICK_OK:
                            view1.hiddenView();

                            //TDGAMission.OnBegin(WGStrings.getText(8110));
                            break;

                        case MDAlertBehaviour.DID_HIDDEN:
                            WGAlertViewController.Self.destroyAlertView(view1);

                            //TDGAMission.OnCompleted(WGStrings.getText(8110));

                            break;
                        }
                    };
                }
                if (hs == EMHelpStates.Use_Item)
                {
                    WGGameUIView.Instance.mMainMenuView.unLightBtnSkill4();
                    WGSkillController.Instance.ReleaseSkillWithID(WGDefine.SK_FangYu4);
                }
                if (hs == EMHelpStates.Use_Weapon)
                {
                    WGGameUIView.Instance.mMainMenuView.unLightBtnAdd();
                    WGBearManage.Instance.csThrow.ChangeWeaponAdd();
                    //WGSkillController.Instance.ReleaseSkillWithID(WGDefine.SK_GuDing30);
                }
                view.hiddenView();
                //Debug.Log("Completed ========"+missionName);
                //TDGAMission.OnCompleted(missionName);
                break;

            case MDAlertBehaviour.DID_SHOW:
                Time.timeScale = 0;
                break;

            case MDAlertBehaviour.DID_HIDDEN:
                Time.timeScale = 1;
                Destroy(curGuideView.gameObject);
                curGuideView = null;
                StartCoroutine(resetViewShow());
                break;
            }
        };
    }
Exemplo n.º 20
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;
                    }
                };
            }
        }
    }
Exemplo n.º 21
0
    public void OnApplicationPause(bool pause)
    {
        if (pause)
        {
                        #if Add_AD
            if (DataPlayerController.getInstance().data.DelAD == 0)
            {
                IOSAD.showInterstitialMoGo();
            }
                        #endif

            DataPlayerController.getInstance().saveDataPlayer();

                        #if UNITY_IPHONE || UNITY_IOS
            System.DateTime today = System.DateTime.Now;


            int canGotNum = Mathf.Max(WGConfig.AUTO_ADD_MAX - _DataPlayer.Coin, 0) / 10;
            if (canGotNum > 0)
            {
                for (int i = 0; i < canGotNum; i++)
                {
                    LocalNotification ln = new LocalNotification();
                    ln.applicationIconBadgeNumber = (i + 1) * 10;

                    System.DateTime answer = today.AddSeconds((i + 1) * 60);

                    ln.fireDate = answer;

                    NotificationServices.ScheduleLocalNotification(ln);
                }
            }

            today = System.DateTime.Now;

            int hour = 24 - today.Hour;
            int min  = 10 + 60 - today.Minute;


            LocalNotification ln1 = new LocalNotification();
            ln1.alertBody   = WGStrings.getText(1036);
            ln1.alertAction = WGStrings.getText(1037);
            ln1.hasAction   = true;
            ln1.fireDate    = today.Add(new System.TimeSpan(hour, min, 0));
            ln1.soundName   = LocalNotification.defaultSoundName;

            NotificationServices.ScheduleLocalNotification(ln1);
                        #endif

            MDDataCoin dc = DataCoinController.getInstance().data;

            dc.CoinID.Clear();
            dc.CoinPos.Clear();
            dc.CoinRoto.Clear();
            for (int i = 0, max = cs_ObjManager._szLiveCoin.Count; i < max; i++)
            {
                BCGameObj go = cs_ObjManager._szLiveCoin[i].GetComponent <BCGameObj>();
                dc.CoinID.Add(go.ID);
                dc.CoinPos.Add(SDK.to3Float(go.transform.position));
                dc.CoinRoto.Add(SDK.to3Float(go.transform.localEulerAngles));
            }
            DataCoinController.getInstance().saveDataCoin();

#if TalkingData
//			int[] szDa = new int[]{10000,90000,80000,70000,60000,50000,40000,30000,20000,10000,8000,6000,4000,2000,};
//			Dictionary<string, object> dic = new Dictionary<string, object>();
//			if(mGotCoinNum>100000)
//			{
//				dic.Add("getCoinNum", "10w");
//
//			}
//			else if(mGotCoinNum>90000)
//			{
//				dic.Add("getCoinNum","9w_10w");
//			}
//			else if(mGotCoinNum>80000)
//			{
//				dic.Add("getCoinNum","8w_9w");
//			}
////			else if(mGotCoinNum>
//			TalkingDataGA.OnEvent(WGStrings.getText(9001), dic);
#endif
        }
        else
        {
                        #if Add_AD
            if (DataPlayerController.getInstance().data.DelAD == 0)
            {
                IOSAD.readyInterstitialAds();
            }
                        #endif
            mGotCoinNum = 0;
            CleanNotification();
            CheckDefenseTime();
        }
    }
Exemplo n.º 22
0
    public void freshViewWithData(MDShopData data)
    {
        mData = data;

        if (labCost != null)
        {
            if (data.type == MDShopData.JEWEL)
            {
                labCost.text = WGStrings.getFormate(1044, data.cost_num);
                //WGStrings.getText(1044) + data.cost_num.ToString();
            }
            else
            {
                labCost.text = data.cost_num.ToString();
            }
        }
        if (spMoneyIcon != null)
        {
            if (data.cost_type == 0)
            {
                spMoneyIcon.spriteName = "coin_105";
                labCost.color          = coinColor;
            }
            else if (data.cost_type == 1)
            {
                spMoneyIcon.spriteName = "gem_104";
                labCost.color          = gemColor;
            }
            spMoneyIcon.MakePixelPerfect();
        }
        if (labProductDes != null && !string.IsNullOrEmpty(data.pdes))
        {
            labProductDes.text = data.pdes;
        }
        if (data.type == MDShopData.ITEM)
        {
            if (labGotNum != null)
            {
                labGotNum.text = data.des;
            }
            GetTimeCount(data);
        }
        else
        {
            if (labGotNum != null)
            {
                labGotNum.text = data.get_num.ToString();
            }
            mTimeCount = 0;
        }

        showTimeCount();

        spCellIcon.spriteName = data.icon;
        if (data.type == MDShopData.COIN || data.type == MDShopData.JEWEL)
        {
            if (data.icon.Equals("CoinUI49") || data.icon.Equals("CoinUI53"))
            {
                spCellIcon.transform.localPosition = szPosition[0];
                spGrayBg1.ESetActive(true);
                spGrayBg2.ESetActive(false);
            }
            else
            {
                spGrayBg1.ESetActive(false);
                spGrayBg2.ESetActive(true);
                spCellIcon.transform.localPosition = szPosition[1];
            }
        }
        else
        {
        }
        spCellIcon.MakePixelPerfect();
    }
Exemplo n.º 23
0
 string mString(int id)
 {
     return(WGStrings.getText(id));
 }
Exemplo n.º 24
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();
            }
        }
    }
Exemplo n.º 25
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();
        }
    }
Exemplo n.º 26
0
    public void FreshWithMsg(string title, string content, bool showCancel = false, bool isBlue = false, bool notGift = false)
    {
        goBtnOk.SetActive(!bDoubleReward);
        goBtnOk1.SetActive(bDoubleReward);
        goBtnOk2.SetActive(bDoubleReward);
        if (notGift)
        {
            goBtnOk2.transform.Find("Diamond").ESetActive(true);
        }
        else
        {
            goBtnOk2.transform.Find("Diamond").ESetActive(false);
        }
        labTitle.text   = title;
        labContent.text = content;
        btnCancel.ESetActive(showCancel);
        if (mRType == YHRewardType.Cheap ||
            mRType == YHRewardType.Lucky ||
            mRType == YHRewardType.NewUser ||
            mRType == YHRewardType.Rich ||
            mRType == YHRewardType.Item ||
            mRType == YHRewardType.Coin ||
            mRType == YHRewardType.Jewel ||
            mRType == YHRewardType.SuperTiger)
        {
            if (YeHuoSDK.mTipType != 0)
            {
                labContent.text = "";
            }
        }

        if (isBlue)
        {
            spTitle.spriteName = "bg_rewardTitle_blue";
            labTitle.color     = new Color(205f / 255f, 245f / 255f, 252f / 255f);
        }
        else
        {
            spTitle.spriteName = "bg_rewardTitle";
        }
//		if(mRType == YHRewardType.Levelup)
//		{
//			labButtonOkText.text = WGStrings.getText(1023);
//		}
//		else
        {
            if (mRType == YHRewardType.Levelup || mRType == YHRewardType.SuperTiger)
            {
                labButtonOk1.text = WGStrings.getText(1007);
            }
            else
            {
                labButtonOk1.text = WGStrings.getText(1023);
            }
#if YES_OK
            labButtonOkText.text = WGStrings.getText(1002);
            labButtonOk2.text    = WGStrings.getText(1104);
#elif YES_BUY
            labButtonOkText.text = WGStrings.getText(1094);
            labButtonOk2.text    = WGStrings.getText(1104);
#elif YES_GET
            labButtonOkText.text = WGStrings.getText(1023);
            labButtonOk2.text    = WGStrings.getText(1101);
#elif YES_QueRen
            labButtonOkText.text = WGStrings.getText(1106);
            labButtonOk2.text    = WGStrings.getText(1104);
#else
            labButtonOkText.text = WGStrings.getText(1023);
            labButtonOk2.text    = WGStrings.getText(1101);
#endif
        }
    }
Exemplo n.º 27
0
    public void showTsunamiView(float time)
    {
        base.showView();
//		Time.timeScale = 0.5f;
        _topTime        = time + 2;
        tpStep1.enabled = false;
        goContent.ESetActive(true);
        tsStep1.ESetActive(true);
        tsStep1.ResetToBeginning();
        taStep1.ResetToBeginning();
        tsStep1.PlayForward();
        taStep1.PlayForward();
        tsStep2.ESetActive(false);
        texBianKuang.ESetActive(false);
        goStep4.ESetActive(false);
        InvokeBlock(0.32f, () => {
            tsStep2.style = UITweener.Style.PingPong;
            tsStep2.from  = Vector3.one * 1.25f;
            tsStep2.to    = Vector3.one;
            tsStep2.ESetActive(true);
            tsStep2.duration = 0.4f;
            tsStep2.ResetToBeginning();
            tsStep2.PlayForward();
            goKuangbaoBackEffect.ESetActive(true);

            InvokeBlock(2.4f, () => {
//				Time.timeScale = 1;
                Destroy(taStep1);

                tsStep1.to      = Vector3.one * 0.3438296f;
                tpStep1.enabled = false;
                tsStep1.PlayForward();
                tpStep1.PlayForward();

                goKuangbaoBackEffect.ESetActive(false);

                tsStep2.from = tsStep2.transform.localScale;
                tsStep2.to   = Vector3.one * 2;

                tsStep2.duration = 0.3f;
                tsStep2.style    = UITweener.Style.Once;


                for (int i = 0; i < 40; i++)
                {
                    InvokeBlock(0.32f + 0.5f * (i + 1), () => {
                        GameObject go              = Instantiate(goBaiKuang) as GameObject;
                        go.transform.parent        = goContent.transform;
                        go.transform.localPosition = goBaiKuang.transform.localPosition;
                        go.ESetActive(true);
                    });
                }



                texBianKuang.ESetActive(true);
                goStep4.ESetActive(true);
                tsStep4.PlayForward();
                labTipTitle.text = WGStrings.getText(1027);
            });
        });

        InvokeBlock(0.85f * _topTime, () => {
            labTipTitle.text = WGStrings.getText(1028);
        });
        InvokeBlock(_topTime, () => {
            hiddenView();
        });
    }