Ejemplo n.º 1
0
    public void didCompleteWithRecepit(string recepit, string productId)
    {
        //WG.SLog("didCompleteWithRecepit==="+productId);
                #if UNITY_ANDROID
#else
        WGAlertViewController.Self.hiddenConnecting();
        IAP.didFinishLastTransaction(productId);
                #endif
        for (int i = 0; i < szIAPData.Count; i++)
        {
            if (productId.Equals(szIAPData[i].proid) || productId.Equals(szIAPData[i].proid2))
            {
                _dataPlayer.Jewel += szIAPData[i].get_num;
#if Add_AD
                if (!szIAPData[i].proid.Equals("Coins_60"))
                {
                    WGGameWorld.Instance.RemoveAd();
                }
#endif
#if Umeng
                Umeng.GA.Pay(szIAPData[i].cost_num, Umeng.GA.PaySource.AppStore, szIAPData[i].get_num);
#endif
                DataPlayerController.getInstance().saveDataPlayer();
                WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN);
                WGAlertViewController.Self.showTipView(1001);
            }
        }
    }
Ejemplo n.º 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]
    }
Ejemplo n.º 3
0
    void SwitchChangeValue()
    {
        DataPlayerController dpc = DataPlayerController.getInstance();

        dpc.data.releaseGuding = mySwitch.value?1:0;
        WGSkillController.Instance.ReleaseSkillWithID(mData.id);
    }
Ejemplo n.º 4
0
    void BuySuccess(TBData data)
    {
        string order = ShopOrderManager.getInstance().getOrderDes(data.order);

        for (int i = 0; i < szIAPData.Count; i++)
        {
            if (order.Equals(szIAPData[i].proid))
            {
                ShopOrderManager.getInstance().setOrderStatu(order, ShopOrderManager.BuyEndStates);
                ShopOrderManager.getInstance().saveShopOrder();

                _dataPlayer.Jewel += szIAPData[i].get_num;
                                #if Add_AD
                if (!szIAPData[i].proid.Equals("Coins_60"))
                {
                    WGGameWorld.Instance.RemoveAd();
                }
                                #endif
#if Umeng
                Umeng.GA.Pay(szIAPData[i].cost_num, Umeng.GA.PaySource.TongBu, szIAPData[i].get_num);
#endif

                DataPlayerController.getInstance().saveDataPlayer();
                WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN);
                WGAlertViewController.Self.showTipView(1001);
            }
        }
    }
Ejemplo n.º 5
0
    public override void OnBtnOk()
    {
        BCSoundPlayer.Play(MusicEnum.button);

        DataPlayerController dpc       = DataPlayerController.getInstance();
        WGDataController     _dataCtrl = WGDataController.Instance;
        int numleft   = _dataCtrl.GetCollectionOwnNum(itemID1);
        int numMiddle = _dataCtrl.GetCollectionOwnNum(itemID2);
        int numRight  = _dataCtrl.GetCollectionOwnNum(itemID3);

        if (Mathf.Min(numleft, numMiddle, numRight) >= mSellCount)
        {
            _dp.Coin += Mathf.CeilToInt(mGotCoin + 0.5f);

            dpc.addCollectionNum(itemID1, -mSellCount);
            dpc.addCollectionNum(itemID2, -mSellCount);
            dpc.addCollectionNum(itemID3, -mSellCount);
//			Dictionary<string, object> dic = new Dictionary<string, object>();
//			dic.Add("SellNum",mSellCount.ToString());
//			//WG.SLog("=actionId="+WGStrings.getText(9005)+col1.groupdes+"==parameters="+SDK.Serialize(dic));
//
//			TalkingDataGA.OnEvent(WGStrings.getText(9005)+col1.groupdes, dic);
//#endif



            DataPlayerController.getInstance().saveDataPlayer();

            WGGameUIView.Instance.freshPlayerUI(UI_FRESH.COIN);
        }
        WGGameUIView.Instance.freshMenuButton(2);
        base.OnBtnOk();
    }
Ejemplo n.º 6
0
    void OnBtnSign()
    {
        //WGGameUIView.Instance.ViewControllerDoAct(BTN_ACT.Sign);


        int  curday  = Core.now.DayOfYear;
        int  lastDay = _DataPlayer.lastDailyRewardTime.DayOfYear;
        bool signed  = false;

        if (curday == lastDay)
        {
            signed = true;
        }
        else
        {
            signed = false;
        }
        WGDailyRewardView rewardView = WGDailyRewardView.CreateDailyView(signed);

        if (curday > lastDay + 1)
        {
            _DataPlayer.ContinuousDay = 0;
            DataPlayerController.getInstance().saveDataPlayer();
        }
        if (signed)
        {
            rewardView.freshWithDailyReward(_DataPlayer.ContinuousDay, signed);
        }
        else
        {
            if (_DataPlayer.ContinuousDay >= 7)
            {
                _DataPlayer.ContinuousDay = 0;
                DataPlayerController.getInstance().saveDataPlayer();
            }
            rewardView.freshWithDailyReward(_DataPlayer.ContinuousDay, signed);
        }


        rewardView.alertViewBehavriour = (ab, view) => {
            freshSign();
            switch (ab)
            {
            case MDAlertBehaviour.CLICK_OK:
                view.hiddenView();
                _DataPlayer.ContinuousDay++;
                //if(_DataPlayer.ContinuousDay>7)_DataPlayer.ContinuousDay = 0;
                DataPlayerController.getInstance().saveDataPlayer();
                break;

            case MDAlertBehaviour.DID_HIDDEN:
                Destroy(view.gameObject);
                WGAlertManager.Self.RemoveHeadAndShowNext();
                break;
            }
        };
        BCSoundPlayer.Play(MusicEnum.showReward, 1f);
        rewardView.showView();
    }
Ejemplo n.º 7
0
 public static DataPlayerController getInstance()
 {
     if (dataCtrl == null)
     {
         dataCtrl = new DataPlayerController();
     }
     return(dataCtrl);
 }
Ejemplo n.º 8
0
    public void freshUI(int id)
    {
        spColletion.spriteName = "s" + id.ToString();
        DataPlayerController dpc = DataPlayerController.getInstance();
        int num = dpc.getCollectionNum(id);

        labColNum.text = num + "/10";
    }
Ejemplo n.º 9
0
 void AutoSave()
 {
     if (hasChanged && Time.realtimeSinceStartup - lastChangeTime > 15)
     {
         lastChangeTime = Time.realtimeSinceStartup;
         hasChanged     = false;
         DataPlayerController.getInstance().saveDataPlayer();
     }
 }
Ejemplo n.º 10
0
    void freshUIWithBearID(int id)
    {
        BCObj       obj  = _dataCtrl.GetBCObj(id);
        WGBearParam bear = _dataCtrl.GetBearParam(id);

        DataPlayer _dp = DataPlayerController.getInstance().data;

        int curLv = _dp.Level;

        bool isGray = false;


        if (bear.unlock >= 0)
        {
            gemLockView.ESetActive(false);
            if (curLv >= bear.unlock)         //解锁
            {
                isGray = false;
                unLockView.ESetActive(true);
                levelLockView.ESetActive(false);
                WGShowBearController.Instance.ShowMode(0);
            }
            else             //需要到达等级解锁
            {
                isGray = true;
                unLockView.ESetActive(false);
                levelLockView.ESetActive(true);
                WGShowBearController.Instance.ShowMode(2);
            }
        }
        else
        {
            levelLockView.ESetActive(false);
            if (_dp.szPayObjID.Contains(id))           //解锁
            {
                unLockView.ESetActive(true);
                gemLockView.ESetActive(false);
                isGray = false;
                WGShowBearController.Instance.ShowMode(0);
            }
            else             //需要花钻石解锁,没有解锁
            {
                isGray = true;
                unLockView.ESetActive(false);
                gemLockView.ESetActive(true);
                WGShowBearController.Instance.ShowMode(1);
            }
        }

        unLockView.freshWithBearID(obj.Name, bear.des);
        gemLockView.freshWithBearID(obj.Name, bear.des);
        levelLockView.freshWithBearID(obj.Name, bear.des);


        WGShowBearController.Instance.ShowMonsterWithID(id, isGray);
    }
Ejemplo n.º 11
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);
        }
    }
Ejemplo n.º 12
0
    void InitView()
    {
        if (bInit)
        {
            return;
        }
        bInit = true;
        int index = DataPlayerController.getInstance().data.r;

        SelectWithIndex(index);
    }
Ejemplo n.º 13
0
    void GetReward(bool bDouble)
    {
        DataPlayerController dpc  = DataPlayerController.getInstance();
        DataPlayer           _dp  = dpc.data;
        BCGameObjectType     type = WGDataController.Instance.GetBCObjType(curReward.reward);
        BCObj obj = WGDataController.Instance.GetBCObj(curReward.reward);

        switch (type)
        {
        case BCGameObjectType.Coin:
            _dp.Coin = _dp.Coin + curReward.got_num;
            if (bDouble)
            {
                _dp.Coin = _dp.Coin + curReward.got_num;
            }
            break;

        case BCGameObjectType.Collection:
            dpc.addCollectionNum(curReward.reward, curReward.got_num);
            if (bDouble)
            {
                dpc.addCollectionNum(curReward.reward, curReward.got_num);
            }
            break;

        case BCGameObjectType.Item:
            dpc.AddSkillNum(curReward.reward, curReward.got_num);
            if (bDouble)
            {
                dpc.AddSkillNum(curReward.reward, curReward.got_num);
            }
            break;

        case BCGameObjectType.Jewel:
            _dp.Jewel += curReward.got_num;
            if (bDouble)
            {
                _dp.Jewel += curReward.got_num;
            }
                        #if TalkingData
            TDGAVirtualCurrency.OnReward(curReward.got_num, "DailyReward");
                        #endif
                        #if Umeng
            Umeng.GA.Bonus(curReward.got_num, Umeng.GA.BonusSource.Source2);
                        #endif
            break;
        }

        _dp.lastDailyRewardTime = Core.now;

        dpc.saveDataPlayer();

        WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN | UI_FRESH.COIN);
    }
Ejemplo n.º 14
0
    void freshData()
    {
        szHaveGot.Clear();
        szReached.Clear();
        szNoReached.Clear();
        DataPlayer _dp = DataPlayerController.getInstance().data;

        for (int i = 0, max = WGDataController.Instance.szAchievement.Count; i < max; i++)
        {
            MDAchievement ach      = WGDataController.Instance.szAchievement[i];
            int           reachNum = WGAchievementManager.Self.getAchievementProgress(ach);

            if (_dp.dicGotAchReward.ContainsKey(ach.id))
            {
                if (_dp.dicGotAchReward[ach.id] == 1)
                {
                    szReached.Add(ach);
                }
                else if (_dp.dicGotAchReward[ach.id] == -1)
                {
                    szHaveGot.Add(ach);
                }
                else
                {
                    if (reachNum >= ach.goal_num)
                    {
                        _dp.dicGotAchReward[ach.id] = 1;
                        szReached.Add(ach);
                    }
                    else
                    {
                        _dp.dicGotAchReward[ach.id] = 0;
                        szNoReached.Add(ach);
                    }
                }
            }
            else
            {
                if (reachNum >= ach.goal_num)
                {
                    _dp.dicGotAchReward.Add(ach.id, 1);
                    szReached.Add(ach);
                }
                else
                {
                    _dp.dicGotAchReward.Add(ach.id, 0);
                    szNoReached.Add(ach);
                }
            }
        }


        WGAchievementManager.Self.bCompleteAchievement = szReached.Count > 0;
    }
Ejemplo n.º 15
0
 public void reFreshSkill()
 {
     mSkillNum   = DataPlayerController.getInstance().getSkillNum(mSkillID);
     labNum.text = mSkillNum.ToString();
     if (mSkillNum > 0)
     {
         labNum.color = Color.white;
     }
     else
     {
         labNum.color = Color.red;
     }
 }
Ejemplo n.º 16
0
    public void OnBuyWithMDShopData(MDShopData data)
    {
#if UNITY_ANDROID
        sCurBuy = "" + data.proid2;

        YeHuoSDK.YHPay(sCurBuy, (float)data.cost_num, data.get_num, (success) => {
            if (success)
            {
                for (int i = 0; i < szIAPData.Count; i++)
                {
                    if (sCurBuy.Equals(szIAPData[i].proid2))
                    {
                        _dataPlayer.Jewel += szIAPData[i].get_num;

                        DataPlayerController.getInstance().saveDataPlayer();
                        WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN);
                        WGAlertViewController.Self.showTipView(1001);
                    }
                }
            }
        });
#else
        WGAlertViewController.Self.showConnecting();
                #if TEST
        mnIvokeBlock.InvokeBlock(0.3f, () => {
            didCompleteWithRecepit("", data.proid);
        });
                #elif TBSDK
        if (TBSDK.TBIsLogined())
        {
            string order = data.proid + "_" + Core.nData.sysTime + "_" + TBSDK.TBUserID();

            Debug.Log(order);

            ShopOrderManager.getInstance().SetOrderDes(order, data.proid);
            ShopOrderManager.getInstance().setOrderStatu(order, ShopOrderManager.BuyingStates);
            ShopOrderManager.getInstance().saveShopOrder();
            TBSDK.TBPayRMB(data.cost_num, order, data.proid);
        }
        else
        {
            TBSDK.TBLogin(0);
        }
                #else
        IAP.payForProIdentifier(data.proid);
                #endif
#endif
    }
Ejemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     _bearManage = WGBearManage.Instance;
     if (DataPlayerController.getInstance().data.DelAD == 0)
     {
                     #if Add_AD
         goContent.transform.localPosition = v3ADPos;
                     #else
         goContent.transform.localPosition = v3Pos;
                     #endif
     }
     else
     {
         goContent.transform.localPosition = v3Pos;
     }
 }
Ejemplo n.º 18
0
    void SelectWithIndex(int index)
    {
        DataPlayerController.getInstance().data.r = index;
        szBottomQuan[curSelectIndex].color = cUnSelect;
        szHeadGuang[curSelectIndex].color  = cUnSelect;
        curSelectIndex = index;
        szBottomQuan[curSelectIndex].color = cSelect;
        szHeadGuang[curSelectIndex].color  = cSelect;

        szLabPrecent[0].text  = Core.fc.szRoles[curSelectIndex].attack.ToString() + "%";
        szLabPrecent[1].text  = Core.fc.szRoles[curSelectIndex].max.ToString();
        szLabPrecent[2].text  = Core.fc.szRoles[curSelectIndex].add.ToString();
        sdAttPrecent[0].value = Core.fc.szRoles[curSelectIndex].attV;
        sdAttPrecent[1].value = Core.fc.szRoles[curSelectIndex].maxV;
        sdAttPrecent[2].value = Core.fc.szRoles[curSelectIndex].addV;
    }
Ejemplo n.º 19
0
    void showTimeCount()
    {
        DataPlayerController dpc = DataPlayerController.getInstance();
        bool show = mTimeCount > 0;

        goCommon.ESetActive(!show);
        labTimeCount.ESetActive(show);
        labHasBuy.ESetActive(show);
        if (mData.id == WGDefine.SK_GuDing)
        {
//			CancelInvoke("TimeCount");
            isBeginTimeCount = false;
            fTimeCount       = 0;
            labTimeCount.ESetActive(false);

            if (dpc.data.guDingForever > 0)
            {
                mySwitch.ESetActive(true);
                goCommon.ESetActive(false);
                spBackground4.ESetActive(false);
            }
            else
            {
                mySwitch.ESetActive(false);
                goCommon.ESetActive(true);
                spBackground4.ESetActive(true);
            }
        }
        else
        {
            mySwitch.ESetActive(false);
            spBackground4.ESetActive(true);
            if (show)
            {
//				CancelInvoke("TimeCount");
//				InvokeRepeating("TimeCount",1,1);
                isBeginTimeCount = true;
                fTimeCount       = 0;
            }
            else
            {
//				CancelInvoke("TimeCount");
                isBeginTimeCount = false;
                fTimeCount       = 0;
            }
        }
    }
Ejemplo n.º 20
0
    public void CheckStaticWeapon()
    {
        DataPlayer _dp = DataPlayerController.getInstance().data;


        if (_dp.guDingForever > 0 && _dp.releaseGuding > 0)
        {
            bUseStaticWeapon = true;
        }
        else if (_dp.guDingTime > 0)
        {
            bUseStaticWeapon = true;
        }
        else
        {
            bUseStaticWeapon = false;
        }

        _Weapon.trBullet.enabled = !bUseStaticWeapon;
    }
Ejemplo n.º 21
0
 void FreshTimeCount()
 {
     if (DataPlayerController.getInstance().data.Coin < WGConfig.AUTO_ADD_MAX)
     {
         if (!_bCounting)
         {
             lab_Time.gameObject.SetActive(true);
             sp_Time.gameObject.SetActive(true);
             _bCounting = true;
         }
     }
     else
     {
         if (_bCounting)
         {
             _bCounting = false;
             sp_Time.gameObject.SetActive(false);
             lab_Time.gameObject.SetActive(false);
         }
     }
 }
Ejemplo n.º 22
0
    // Use this for initialization
    void Start()
    {
        DataPlayer _dataPlayer = DataPlayerController.getInstance().data;

        int skID = 0;

        for (int i = 0; i < Core.fc.szReleaseSkill.Length; i++)
        {
            skID = Core.fc.szReleaseSkill[i];
            WGSkillView sk = WGSkillView.CreateSkillView();
            sk.freshSkillView(skID);
            szSkills.Add(sk);
            SDK.AddChild(sk.gameObject, szSkillsPanel[i]);

            sk.myReleaseSkill += this.myReleaseSkillWithID;
        }
        goSuperTiger.ESetActive(YeHuoSDK.bTiger_HuaFei);
        goHuaFei.ESetActive(false);

        //spBackground.height = YeHuoSDK.bTiger_HuaFei?536:437;

        if (YeHuoSDK.bUsePayCode2)
        {
            btnChaoZhi.ESetActive(false);
        }
        else
        {
            if (_DataPlayer.szBigReward.Contains(4))
            {
                btnChaoZhi.ESetActive(false);
            }
            else
            {
                btnChaoZhi.ESetActive(true);
            }
        }
        WGGameUIView.Instance.freshMenuButton();
    }
Ejemplo n.º 23
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");
        }
    }
Ejemplo n.º 24
0
    int GetRandomID()
    {
        //		return 9;

        DataPlayer _dp = DataPlayerController.getInstance().data;



        int maxWeight = _AllTigerWeight;


        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]
    }
Ejemplo n.º 25
0
 public void PlayerGetCollection(int id)
 {
     WGGameUIView.Instance.freshMenuButton(2);
     DataPlayerController.getInstance().addCollectionNum(id, 1);
 }
Ejemplo n.º 26
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();
            }
        }
    }
Ejemplo n.º 27
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();
        }
    }
Ejemplo n.º 28
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;
        }
    }
Ejemplo n.º 29
0
	public void setData(DataPlayerController controller){
		userInfo.gameObject.SetActive (true);
		userInfo.showUserInfo (controller);
	}
Ejemplo n.º 30
0
    void OnBtnGetReward()
    {
        WGDataController     _dataCtrl = WGDataController.Instance;
        DataPlayerController dpc       = DataPlayerController.getInstance();

        if (dpc.data.dicGotAchReward[preAchievementData.id] != 1)
        {
            WGAlertViewController.Self.showAlertView(1016).alertViewBehavriour = (ab, view) => {
                switch (ab)
                {
                case MDAlertBehaviour.CLICK_OK:
                    view.hiddenView();
                    break;

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

        int objID  = preAchievementData.reward[0];
        int gotNum = preAchievementData.reward[1];

        BCObj obj = _dataCtrl.GetBCObj(objID);

        switch (obj.BCType)
        {
        case BCGameObjectType.Item:
            dpc.AddSkillNum(objID, gotNum);
            WGGameUIView.Instance.freshSkillNum();
            break;

        case BCGameObjectType.Collection:
            dpc.addCollectionNum(objID, gotNum);
            break;

        case BCGameObjectType.Coin:
            dpc.data.Coin += gotNum;
            WGGameUIView.Instance.freshPlayerUI(UI_FRESH.COIN);
            break;

        case BCGameObjectType.Jewel:
            dpc.data.Jewel += gotNum;
#if TalkingData
            TDGAVirtualCurrency.OnReward(gotNum, "AchievementReward");
#endif
#if Umeng
            Umeng.GA.Bonus(gotNum, Umeng.GA.BonusSource.Source4);
#endif
            WGGameUIView.Instance.freshPlayerUI(UI_FRESH.BCOIN);
            break;
        }

        dpc.data.dicGotAchReward[preAchievementData.id] = -1;

//		WGAlertViewController.Self.showAlertView(1015).alertViewBehavriour =(ab,view)=>{
//			switch(ab)
//			{
//			case MDAlertBehaviour.CLICK_OK:
//				view.hiddenView();
//				if(curAchViewManager != null)
//				{
//					curAchViewManager.ReloadAchievement();
//				}
//				break;
//			case MDAlertBehaviour.DID_HIDDEN:
//				WGAlertViewController.Self.hiddeAlertView(view.gameObject);
//				break;
//			}
//		};
        if (curAchViewManager != null)
        {
            curAchViewManager.ReloadAchievement();
        }
    }
Ejemplo n.º 31
0
 void OnApplicationQuit()
 {
     DataPlayerController.getInstance().saveDataPlayer();
 }