public static D04PowerTipView CreatePowerPayView() { Object obj = Resources.Load("pbD04PowerTipView"); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; D04PowerTipView t = go.GetComponent <D04PowerTipView>(); SDK.AddChild(go, WGRootManager.Self.goRootGameUI); return(t); } return(null); }
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(); } }