void OnBtnSuperTiger() { if (!WGAlertManager.Self.bSuperTiger) { WGAlertManager.Self.bSuperTiger = true; WGAlertManager.Self.AddAction(() => { D0330SuperTiger st = D0330SuperTiger.CreateSuperTiger(); SDK.AddChild(st.gameObject, WGRootManager.Self.goRootGameUI); st.alertViewBehavriour = (ab, view) => { switch (ab) { case MDAlertBehaviour.CLICK_OK: view.hiddenView(); break; case MDAlertBehaviour.DID_SHOW: WGAlertManager.Self.bSuperTiger = false; break; case MDAlertBehaviour.DID_HIDDEN: Destroy(view.gameObject); WGAlertManager.Self.bSuperTiger = false; WGAlertManager.Self.RemoveHead(); WGAlertManager.Self.ShowNext(); break; } }; st.showView(); }); WGAlertManager.Self.ShowNext(); } }
public void OneCoinDropAtPos(int coin) { int num = 5; if (coin > 50) { num = 10; } else if (coin > 20) { num = 7; } for (int i = 0; i < num; i++) { GameObject go = Instantiate(pbCoin) as GameObject; SDK.AddChild(go, _gameObject); Vector3 v3pos = new Vector3(Random.Range(-300, 300), -515, 0); go.transform.localPosition = v3pos; v3pos.y = Random.Range(50, 100); MiniItween it = MiniItween.MoveTo(go, v3pos, 0.4f, MiniItween.EasingType.Bounce3); it.myDelegateFuncWithObject += this.MoveEnd; } }
public WGTipAlertView showTipView(string msg) { WGTipAlertView tp = WGTipAlertView.CreateTipView(); tp.freshUI(msg); SDK.AddChild(tp.gameObject, goTopView); tp.showView(); return(tp); }
// public WGTipAlertView showArchivementTipView(int msgID){ // return showArchivementTipView (mString (msgID)); // } public WGTipAlertView showArchivementTipView(string msg, string icon) { WGTipAlertView tp = WGTipAlertView.CreateArchivementView(); tp.Icon.GetComponent <UISprite>().spriteName = icon; tp.freshUI(msg); SDK.AddChild(tp.gameObject, goTopView); tp.showView(); return(tp); }
public static D04Buy10TigerView CreateBuy10TigerView() { Object obj = Resources.Load("pbD04Buy10TigerView"); GameObject go = Instantiate(obj) as GameObject; SDK.AddChild(go, WGRootManager.Self.goRootTopUI); D04Buy10TigerView drv = go.GetComponent <D04Buy10TigerView>(); return(drv); }
void OnBtnSell() { BCSoundPlayer.Play(MusicEnum.button); WGDataController _dataCtrl = WGDataController.Instance; // DataPlayerController dpc = DataPlayerController.getInstance(); if (mCanSellNum > 0) { WGSellGroupItemView sgv = WGSellGroupItemView.CreateSellGroupItemView(); SDK.AddChild(sgv.gameObject, WGRootManager.Self.goRootTopUI); sgv.FreshSellGroupWithID(mObjID1, mObjID2, mObjID3, mCanSellNum); sgv.alertViewBehavriour = (ab, view) => { switch (ab) { case MDAlertBehaviour.CLICK_OK: { view.hiddenView(); FreshUI(); } break; case MDAlertBehaviour.CLICK_CANCEL: view.hiddenView(); break; case MDAlertBehaviour.DID_HIDDEN: Destroy(view.gameObject); break; } }; return; } else { WGAlertViewController.Self.showAlertView(1011).alertViewBehavriour = (ab, view) => { switch (ab) { case MDAlertBehaviour.CLICK_OK: view.hiddenView(); break; case MDAlertBehaviour.DID_HIDDEN: WGAlertViewController.Self.hiddeAlertView(view.gameObject); break; } }; } }
public static D04CustomerServiceView CreateCSView() { Object obj = Resources.Load("pbD04CustomerServiceView"); GameObject go = Instantiate(obj) as GameObject; SDK.AddChild(go, WGRootManager.Self.goRootTopUI); D04CustomerServiceView cs = go.GetComponent <D04CustomerServiceView>(); return(cs); }
public WGAlertView showAlertView1(string msg, string ok, string cancel, int type) { if (alertView == null) { alertView = WGAlertView.CreateAlertView(type); SDK.AddChild(alertView.gameObject, goTopView); } alertView.ESetActive(true); alertView.freshViewWithTitle(msg, ok, cancel); alertView.showView(); return(alertView); }
public static HuaFeiAlertView CreateAlertView() { Object obj = Resources.Load("pbHuaFeiAlertView"); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; SDK.AddChild(go, WGRootManager.Self.goRootTopUI); HuaFeiAlertView v = go.GetComponent <HuaFeiAlertView>(); return(v); } return(null); }
public static WGDailyRewardView CreateDailyView(bool signed = false) { Object obj = Resources.Load("pbWGDailyRewardView"); GameObject go = Instantiate(obj) as GameObject; WGDailyRewardView drv = go.GetComponent <WGDailyRewardView>(); SDK.AddChild(go, WGRootManager.Self.goRootTopUI); drv.InitDailyView(signed); return(drv); }
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 static WGLevelUpViewController CreaetViewController() { Object obj = Resources.Load("pbWGLevelUpViewController"); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; WGLevelUpViewController lu = go.GetComponent <WGLevelUpViewController>(); SDK.AddChild(go, WGRootManager.Self.goRootGameUI); return(lu); } return(null); }
void FreshUI() { WGDataController dc = WGDataController.Instance; for (int i = 0; i < dc.szHuaFei.Count; i++) { MDV2HuaFei hf = dc.szHuaFei[i]; HuaFei_CellView hc = HuaFei_CellView.CreateHuaFeiView(); SDK.AddChild(hc.gameObject, tsContent.gameObject); hc.transform.localPosition = new Vector3(0, 149 - i * 96, 0); hc.freshUI(hf); } }
public static WGGoodView CreateGoodView() { Object obj = Resources.Load("pbWGGoodView"); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; WGGoodView gv = go.GetComponent <WGGoodView>(); SDK.AddChild(go, WGRootManager.Self.goRootGameUI); return(gv); } return(null); }
public static V2RoleSelectView CreateRoleView() { Object obj = Resources.Load("pbV2RoleSelectView"); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; V2RoleSelectView v = go.GetComponent <V2RoleSelectView>(); SDK.AddChild(go, WGRootManager.Self.goRootTopUI); v.InitView(); return(v); } return(null); }
public static V2NewUseRewardView CreateNewUseView() { Object obj = Resources.Load("pbV2NewUseReward"); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; V2NewUseRewardView c = go.GetComponent <V2NewUseRewardView>(); SDK.AddChild(go, WGRootManager.Self.goRootTopUI); c.InitView(); return(c); } return(null); }
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; }
public WGConnectingView showConnecting() { if (conView == null) { conView = WGConnectingView.CreateConnectingView(); SDK.AddChild(conView.gameObject, goTopView); conView.alertViewBehavriour = (ab, alert) => { if (ab == MDAlertBehaviour.DID_HIDDEN) { conView.gameObject.SetActive(false); } }; } conView.gameObject.SetActive(true); conView.showView(); return(conView); }
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; }
public static D04PowerBuyView CreatePowerBuyView(bool isFinger = false) { string prefabName = "pbD04PowerBuyView"; if (isFinger) { prefabName = "pbD04FingerBuyView"; } Object obj = Resources.Load(prefabName); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; D04PowerBuyView v = go.GetComponent <D04PowerBuyView>(); SDK.AddChild(go, WGRootManager.Self.goRootGameUI); return(v); } return(null); }
void OnBtnSetting() { YHAboutGameView aboutView = YHAboutGameView.CreateAboutView(); aboutView.alertViewBehavriour = (ab, view) => { switch (ab) { case MDAlertBehaviour.CLICK_OK: view.hiddenView(); break; case MDAlertBehaviour.DID_HIDDEN: break; } }; SDK.AddChild(aboutView.gameObject, goRoot); aboutView.showView(); }
void Create() { string res = ""; DataCoin dc; using (StreamReader sr = new StreamReader(new MemoryStream(taCoinData.bytes))) { res = sr.ReadToEnd(); dc = SDK.Deserialize <DataCoin>(res); } for (int i = 0; i < dc.CoinPos.Count; i++) { GameObject go = Instantiate(goCoin) as GameObject; SDK.AddChild(go, this.gameObject); go.transform.position = SDK.toV3(dc.CoinPos[i]); go.transform.localScale = coinScale; go.transform.rotation = Quaternion.Euler(new Vector3(0, 0, 180)); } }
public void freshWithDailyReward(int daily, bool signed) { for (int i = 0, max = szDaily7Reward.Count; i < max; i++) { CDailyCellView cell = CDailyCellView.CreateCellView(i + 1); cell.freshDailyCell(szDaily7Reward[i], i + 1, daily + 1); SDK.AddChild(cell.gameObject, szCellPanel[i]); } if (signed) { curReward = szDaily7Reward[daily - 1]; } else { curReward = szDaily7Reward[daily]; } }
void InitView() { if (bInit) { return; } bInit = true; szHFCells = new List <HuaFei_Cell1_3>(); for (int i = 0; i < 3; i++) { HuaFei_Cell1_3 c3 = HuaFei_Cell1_3.CreateHuafeiCell1_3(); SDK.AddChild(c3.gameObject, szPanels[i]); szHFCells.Add(c3); } for (int i = 0; i < szEffect.Length; i++) { szEffect[i].duration = Random.Range(0.5f, 1.2f); szEffect[i].delay = Random.Range(0, 0.5f); } }
void IGotCoin() { if (_mAddCoinNum2 > 350) { if (bGoodViewShow) { } else { bGoodViewShow = true; WGGoodView gv = WGGoodView.CreateGoodView(); SDK.AddChild(gv.gameObject, WGRootManager.Self.goRootGameUI); gv.AddCoinNum(_mAddCoinNum2); // WGAlertManager.Self.AddAction(()=>{ gv.alertViewBehavriour = (ab, view) => { switch (ab) { case MDAlertBehaviour.DID_HIDDEN: Destroy(view.gameObject); bGoodViewShow = false; // WGAlertManager.Self.RemoveHead(); // WGAlertManager.Self.ShowNext(); break; } }; gv.freshUIWith(); gv.showView(); // }); // WGAlertManager.Self.ShowNext(); } } PlayerGetCoin(_mAddCoinNum2); // WGGotCoinEffectView.Self.OneCoinDropAtPos(_mAddCoinNum2); _mAddCoinNum2 = 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(); }
// public void DonotNeedCoin(float time) // { // CancelInvoke("retNeedCoin"); // bNeedCoin = false; // Invoke("retNeedCoin",time); // } // void retNeedCoin() // { // bNeedCoin = true; // } void Start() { if (dp.DelAD == 0) { Up = Up_Add; } else { Up = upTemp; } _ShareWorld = WGGameWorld.Instance; _dataCtrl = WGDataController.Instance; // for(int i=0;i<_dataCtrl.szWeapons.Count;i++) // { // WGWeapon wep = WGWeapon.CreateWeapon(i); // wep.gameObject.SetActive(false); // wep.transform.parent = this.transform; // wep.transform.localPosition = Vector3.zero; // wep.transform.localRotation = Quaternion.Euler(Vector3.zero); // wep.transform.localScale = Vector3.one; // szWeaponGO.Add(wep); // } mWeaponIndex = 0; // _Weapon = szWeaponGO[0]; _Weapon = WGWeapon.CreateWeapon(); SDK.AddChild(_Weapon.gameObject, this.gameObject); _Weapon.transform.localPosition = new Vector3(0, 0, -0.99f); // _Weapon.labCostCoin = labCostNum; _Weapon.ESetActive(true); _weaponData = _dataCtrl.szWeapons[0]; UIEventListener.Get(goEvent).onPress += this.myOnPress; CheckStaticWeapon(); }
public bool ChangeWeapon(int index, int coin) { if (!bCanChange) { return(false); } bCanChange = false; tsChangeNum.enabled = true; taChangeNum.enabled = true; tsChangeNum.PlayForward(); taChangeNum.PlayForward(); InvokeBlock(tsChangeNum.duration, () => { labCostCoin.text = coin.ToString(); // labCostCoin1.text = coin.ToString(); tsChangeNum.PlayReverse(); taChangeNum.PlayReverse(); }); GameObject go = Instantiate(pbChangeEffect) as GameObject; SDK.AddChild(go, this.gameObject); InvokeBlock(1.0f, () => { Destroy(go); }); InvokeBlock(0.3f, () => { curWeaponIndex = index; bCanChange = true; }); if (index > curWeaponIndex) { switch (index) { case 1: { float dt = PlayReverse0_1(); PlayForward1_2(dt * 0.75f); } break; case 2: { float t1 = PlayReverse1_2(); float t2 = PlayReverse0_1(t1); float t3 = PlayForward1_2(t1 + t2 * 0.75f); float t4 = PlayForward2_3(t1 + t2); } break; case 3: { float t1 = PlayReverse2_3(); float t2 = PlayReverse1_2(t1 * 0.25f); float t3 = PlayReverse0_1(t2); float t4 = PlayForward1_2(t2 + t3 * 0.75f); float t5 = PlayForward2_3(t2 + t3); PlayForward3_4(t2 + t3); } break; } } else if (index < curWeaponIndex) { switch (index) { case 0: { float t1 = PlayReverse1_2(); float t2 = PlayForward0_1(t1 * 0.75f); } break; case 1: { float t1 = PlayReverse2_3(); float t2 = PlayReverse1_2(t1); float t3 = PlayReverse0_1(t2 + t1); float t4 = PlayForward1_2(t3 + t1 + t2); } break; case 2: { float t1 = PlayReverse3_4(); float t2 = PlayReverse2_3(t1 * 0.5f); float t3 = PlayReverse1_2(t1 * 0.5f + t2 * 0.75f); float t4 = PlayReverse0_1(t1 * 0.5f + t2 * 0.75f + t3 * 0.75f); float t5 = PlayForward1_2(t1 * 0.5f + t2 * 0.75f + t3 * 0.75f + t4); float t6 = PlayForward2_3(t1 * 0.5f + t2 * 0.75f + t3 * 0.75f + t4 + t5 * 0.5f); } break; } } return(true); }
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(); } } }
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(); } }