Ejemplo n.º 1
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.º 2
0
    public void WhenBearKilled(int id, Transform tran, bool bMiao = false)
    {
        BCSoundPlayer.Play(MusicEnum.hitBear);



        WGAchievementManager.Self.processAchievement(id, DTAchievementType.KILL_ALL);
        WGAchievementManager.Self.processAchievement(id, DTAchievementType.KILL_ONE);
        WGBearParam mBear = dataCtrl.GetBearParam(id);
        BCObj       mOjb  = dataCtrl.GetBCObj(id);

        _ShareWorld.PlayGetExp(mOjb.Exp);


        if (WGHelpManager.Self != null)
        {
            if (WGHelpManager.Self.enabled)
            {
                if (!WGHelpManager.Self.StatesIsEnd(EMHelpStates.Kill_Energy))
                {
                    WGHelpManager.Self.ShowHelpView(EMHelpStates.Kill_Energy);
                }
                else if (!WGHelpManager.Self.StatesIsEnd(EMHelpStates.Kill_Tiger) && mBear.tiger == 1)
                {
                    WGHelpManager.Self.ShowHelpView(EMHelpStates.Kill_Tiger);
                }
                else if (!WGHelpManager.Self.StatesIsEnd(EMHelpStates.Use_Item))
                {
                    WGHelpManager.Self.ShowHelpView(EMHelpStates.Use_Item);
                }
                else if (!WGHelpManager.Self.StatesIsEnd(EMHelpStates.RegetCoin))
                {
                    WGHelpManager.Self.ShowHelpView(EMHelpStates.RegetCoin);
                }
            }
        }


        BearDead(tran.parent);
        szLiveBearID.Remove(id);
        _curBearNum--;
        if (id == WGDefine.BossID)
        {
            _bearBoss = null;
        }
        if (!bHaiXiaoEffect)
        {
            _dataPlayer.mEnergy += mBear.energy;
        }
        if (_dataPlayer.mEnergy >= _EnergyFull)
        {
            if (!_bShowPowerTip)
            {
                if (_dataPlayer.a1 == 0)
                {
                    if (YeHuoSDK.bShowPoweGift)
                    {
                        _bShowPowerTip = true;
                        D04PowerTipView tip = D04PowerTipView.CreatePowerPayView();
                        Time.timeScale          = 0;
                        tip.alertViewBehavriour = (ab, view) => {
                            if (ab == MDAlertBehaviour.CLICK_OK)
                            {
                                Destroy(view.gameObject);
                                showBuyPowerView();
                            }
                        };
                    }
                    else
                    {
                        _dataPlayer.mEnergy -= _EnergyFull;
                        bHaiXiaoEffect       = true;

                        //DonNotNeedCoin(10+2);
//						WGTsunamiView tv = WGTsunamiView.CreateTsunamiView();
//						tv.alertViewBehavriour =(ab,view)=>{
//							switch(ab)
//							{
//							case MDAlertBehaviour.DID_HIDDEN:
//								Destroy(view.gameObject);
//								break;
//							}
//						};
//						SDK.AddChild(tv.gameObject,_ShareWorld.go2DUIBottom);
//						tv.showTsunamiView(10f);

                        csThrow.showTsunamiEffect(true);
                        pgHaiXiao.value = 1;
                        pgHaiXiaoValue  = 1;
                        InvokeRepeating("HaiXiaoEffect", 2f, 10f / 100);
                    }
                }
                else if (_dataPlayer.a1 == 1)
                {
                    _dataPlayer.mEnergy -= _EnergyFull;
                    bHaiXiaoEffect       = true;

                    DonNotNeedCoin(10 + 2);
                    WGTsunamiView tv = WGTsunamiView.CreateTsunamiView();
                    tv.alertViewBehavriour = (ab, view) => {
                        switch (ab)
                        {
                        case MDAlertBehaviour.DID_HIDDEN:
                            Destroy(view.gameObject);
                            break;
                        }
                    };
                    SDK.AddChild(tv.gameObject, _ShareWorld.go2DUIBottom);
                    tv.showTsunamiView(10f);

                    csThrow.showTsunamiEffect(true);
                    pgHaiXiao.value = 1;
                    pgHaiXiaoValue  = 1;
                    InvokeRepeating("HaiXiaoEffect", 2f, 10f / 100);
                }
            }
        }

        if (!bHaiXiaoEffect)
        {
            pgHaiXiao.value = _dataPlayer.mEnergy * 1.0f / _EnergyFull;
        }



//		//WG.SLog("WhenBearKilled======="+SDK.Serialize(mBear.death_reward));
        for (int i = 0, max = mBear.death_reward.Count; i < max; i++)
        {
            _ShareWorld.AddReward(mBear.death_reward[i]);
        }
        if (bMiao && mBear.additional != null && mBear.additional.Count > 0)
        {
            for (int i = 0, max = mBear.additional.Count; i < max; i++)
            {
                _ShareWorld.AddReward(mBear.additional[i]);
            }
        }

        if (mBear.tiger == 1)
        {
            WGGameTiger.Instance.StartTiger();
        }
    }