private void MTABuyPoint() { switch (currentWeaponType) { case WeaponType.dianju: MTAManager.DoEvent(MTAPoint.MINI_BUY_DIANJU); break; case WeaponType.gundouble_fire: MTAManager.DoEvent(MTAPoint.MINI_BUY_DOUBLE_FIRE); break; case WeaponType.gun_fire: MTAManager.DoEvent(MTAPoint.MINI_BUY_FIRE); break; case WeaponType.gundouble_liudan: MTAManager.DoEvent(MTAPoint.MINI_BUY_DOUBLE_LIUDAN); break; case WeaponType.gundouble_m4: MTAManager.DoEvent(MTAPoint.MINI_BUY_DOUBLE_M4); break; case WeaponType.gundouble_sandan: MTAManager.DoEvent(MTAPoint.MINI_BUY_DOUBLE_SANDAN); break; case WeaponType.gundouble_shouqiang: MTAManager.DoEvent(MTAPoint.MINI_BUY_DOUBLE_SHOUQIANG); break; } }
public void OnAoeProp() { if (aoeFreezed) { return; } if (SettingManager.Instance.TotalAoe <= 0) { return; } SettingManager.Instance.UseDaojuTime += 1; SettingManager.Instance.DaojuCost_Shuaxin += 1; GameData.Instance.AddAoe(-1); MTAManager.DoEvent(MTAPoint.MINI_USE_AOE); float duration = IOHelper.GetItemInfoById(1).cd_time; StartCoroutine(aoeCD(duration)); StartCoroutine(PlayAOEEffects()); aoeLabel.text = SettingManager.Instance.TotalAoe.ToString(); }
void MTAUpgradePoint() { switch (type) { case PetType.songshu: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_PET_1); break; case PetType.tuzi: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_PET_2); break; case PetType.pet3: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_PET_3); break; case PetType.pet4: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_PET_4); break; case PetType.pet5: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_PET_5); break; case PetType.pet6: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_PET_6); break; case PetType.pet7: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_PET_7); break; } }
public void OnConfirm() { if (diamondValue > SettingManager.Instance.TotalDiamond) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-diamondValue); if (s_count == 1) { MTAManager.DoEvent(MTAPoint.MINI_BUY_FUHUO_1); } else if (s_count == 2) { MTAManager.DoEvent(MTAPoint.MINI_BUY_FUHUO_2); } else if (s_count == 3) { MTAManager.DoEvent(MTAPoint.MINI_BUY_FUHUO_3); } Time.timeScale = 1.2f; GameData.Instance.Pause = false; GameObject player = GameObject.FindGameObjectWithTag("Player"); player.GetComponent <HeroController>().hp = player.GetComponent <HeroController>().maxHp; UIBattleSceneLogic.Instance.SetHp(player.GetComponent <HeroController>().hp / player.GetComponent <HeroController>().maxHp); // player.GetComponent<HeroController>().ChangeState(AnimState.idle); UIBattleSceneLogic.Instance.PlayAoeEffect(); DialogManager.Instance.CloseDialog(); }
//-------------------------------------- // GET/SET //-------------------------------------- //-------------------------------------- // EVENTS //-------------------------------------- private static void UnlockProducts(string productIdentifier) { switch (productIdentifier) { case ONE_TIER: GameData.Instance.AddDiamond(60); MTAManager.DoEvent(MTAPoint.MINI_BUY_DIAMOND_TYPE_1); break; case FIVE_TIER: GameData.Instance.AddDiamond(320); MTAManager.DoEvent(MTAPoint.MINI_BUY_DIAMOND_TYPE_2); break; case TEN_TIER: GameData.Instance.AddDiamond(750); MTAManager.DoEvent(MTAPoint.MINI_BUY_DIAMOND_TYPE_3); break; case TWENTU_TIER: GameData.Instance.AddDiamond(1700); MTAManager.DoEvent(MTAPoint.MINI_BUY_DIAMOND_TYPE_4); break; case THIRTY_TIER: GameData.Instance.AddDiamond(3000); MTAManager.DoEvent(MTAPoint.MINI_BUY_DIAMOND_TYPE_5); break; case FIFTY_TIER: GameData.Instance.AddDiamond(5400); MTAManager.DoEvent(MTAPoint.MINI_BUY_DIAMOND_TYPE_6); break; } }
void MTABuyPoint() { switch ((PetType)this.Param.pet_type) { case PetType.songshu: MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_1); break; case PetType.tuzi: MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_2); break; case PetType.pet3: MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_3); break; case PetType.pet4: MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_4); break; case PetType.pet5: MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_5); break; case PetType.pet6: MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_6); break; case PetType.pet7: MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_7); break; } }
public void OnBuyAoe() { int diamond = 30; if (diamond > GameData.Instance.currentDiamond) { NotEnoughDiamondDialog.Popup(false); return; } GameData.Instance.AddAoe(1); GameData.Instance.AddDiamond(-diamond); MTAManager.DoEvent(MTAPoint.MINI_BUY_AOE); AoeLabel.text = SettingManager.Instance.TotalAoe.ToString(); }
public void OnBuyJiatelin() { int diamond = 25; if (diamond > GameData.Instance.currentDiamond) { NotEnoughDiamondDialog.Popup(false); return; } GameData.Instance.AddJiatelin(1); GameData.Instance.AddDiamond(-diamond); MTAManager.DoEvent(MTAPoint.MINI_BUY_JIATELIN); JiatelinLabel.text = SettingManager.Instance.TotalJiatelin.ToString(); }
public void OnBuyBindong() { int diamond = 25; if (diamond > GameData.Instance.currentDiamond) { NotEnoughDiamondDialog.Popup(false); return; } GameData.Instance.AddBindong(1); GameData.Instance.AddDiamond(-diamond); MTAManager.DoEvent(MTAPoint.MINI_BUY_BINDONG); BindongLabel.text = SettingManager.Instance.TotalBindong.ToString(); }
public void OnBuyGold(UILabel diamondNum) { int diamond = int.Parse(diamondNum.text); // GameData.Instance.AddGold( if (diamond > GameData.Instance.currentDiamond) { NotEnoughDiamondDialog.Popup(false); return; } switch (diamond) { case 10: GameData.Instance.AddGold(500); MTAManager.DoEvent(MTAPoint.MINI_BUY_GOLD_500); break; case 50: GameData.Instance.AddGold(2500); MTAManager.DoEvent(MTAPoint.MINI_BUY_GOLD_2500); break; case 100: GameData.Instance.AddGold(5200); MTAManager.DoEvent(MTAPoint.MINI_BUY_GOLD_5200); break; case 200: GameData.Instance.AddGold(11000); MTAManager.DoEvent(MTAPoint.MINI_BUY_GOLD_11000); break; case 500: GameData.Instance.AddGold(28000); MTAManager.DoEvent(MTAPoint.MINI_BUY_GOLD_28000); break; case 1000: GameData.Instance.AddGold(88000); MTAManager.DoEvent(MTAPoint.MINI_BUY_GOLD_88000); break; } GameData.Instance.AddDiamond(-diamond); }
public void OnBuyTili(UILabel diamondNum) { int diamond = int.Parse(diamondNum.text); if (diamond > GameData.Instance.currentDiamond) { NotEnoughDiamondDialog.Popup(false); return; } switch (diamond) { case 1: GameData.Instance.AddTili(1); MTAManager.DoEvent(MTAPoint.MINI_BUY_TILI_1); break; case 5: GameData.Instance.AddTili(5); MTAManager.DoEvent(MTAPoint.MINI_BUY_TILI_5); break; case 10: GameData.Instance.AddTili(12); MTAManager.DoEvent(MTAPoint.MINI_BUY_TILI_12); break; case 15: GameData.Instance.AddTili(20); MTAManager.DoEvent(MTAPoint.MINI_BUY_TILI_20); break; case 30: GameData.Instance.AddTili(50); MTAManager.DoEvent(MTAPoint.MINI_BUY_TILI_50); break; case 50: GameData.Instance.AddTili(120); MTAManager.DoEvent(MTAPoint.MINI_BUY_TILI_120); break; } GameData.Instance.AddDiamond(-diamond); }
public void OnConfirm() { OnCancel(); if (GameData.Instance.currentDiamond < this.Param.Cost) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-this.Param.Cost); SettingManager.Instance.PetLocked = 0; MTAManager.DoEvent(MTAPoint.MINI_BUY_PET_SOLT); if (this.Param.m_callback != null) { this.Param.m_callback(); } }
public void OnConfirm() { if (SettingManager.Instance.TotalDiamond < 100) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-100); MTAManager.DoEvent(MTAPoint.MINI_BUY_MAP2); SettingManager.Instance.SceneLocked = 0; if (this.Param.m_callback != null) { this.Param.m_callback(); } DialogManager.Instance.CloseDialog(); }
public void onAddHPProp() { if (SettingManager.Instance.TotalDiamond < 20) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-20); GameData.Instance.AddJiaxue(1); MTAManager.DoEvent(MTAPoint.MINI_BUY_XUE); labelJiaxue.text = SettingManager.Instance.TotalJiaxue.ToString(); #if US_VERSION DialogManager.Instance.PopupFadeOutMessage("Buy this item success"); #else DialogManager.Instance.PopupFadeOutMessage("购买恢复100点生命值成功"); #endif }
public void OnZhiliaoProp() { if (zhiliaoFreezed) { return; } if (SettingManager.Instance.TotalJiaxue <= 0) { return; } SettingManager.Instance.UseDaojuTime += 1; SettingManager.Instance.DaojuCost_Shuaxin += 1; float duration = IOHelper.GetItemInfoById(4).cd_time; StartCoroutine(zhiliaoCD(duration)); MTAManager.DoEvent(MTAPoint.MINI_USE_XUE); float tmp = player.GetComponent <HeroController>().hp; tmp += 100; GameObject addHP = (GameObject)Instantiate(Resources.Load("UI/labelAddHP")); addHP.GetComponent <UILabel>().text = "+100"; addHP.transform.parent = UIBattleSceneLogic.Instance.NGUICamera.transform; addHP.transform.localScale = Vector3.one; addHP.transform.position = Helper.WorldToNGUIPos(Camera.main, UIBattleSceneLogic.Instance.NGUICamera, player.transform.position + player.transform.up * 4); TweenScale.Begin(addHP, 0.6f, Vector3.one * 2); GameObject fu = (GameObject)Instantiate(player.GetComponent <AdditionalEffect>().huifuPrefab); fu.transform.parent = player.transform; fu.transform.position = player.transform.position + new Vector3(0, 0.2f, 0); Ultilities.gm.audioScript.recoverFX.play(); player.GetComponent <HeroController>().hp = Mathf.Min(tmp, player.GetComponent <HeroController>().maxHp); SetHp(player.GetComponent <HeroController>().hp / player.GetComponent <HeroController>().maxHp); GameData.Instance.AddJiaxue(-1); jiaxueLabel.text = SettingManager.Instance.TotalJiaxue.ToString(); SettingManager.Instance.TutorialAddBlood = 0; }
public void DirectPass() { if (SettingManager.Instance.TotalDiamond < 50) { NotEnoughDiamondDialog.Popup(); return; } if (SettingManager.Instance.TotalTili < 1) { NotEnoughTiliDialog.Popup(); return; } GameData.Instance.AddDiamond(-50); MTAManager.DoEvent(MTAPoint.MINI_BUY_DIR_PASS); SettingManager.Instance.NextLevel += 1; GotoNextLevel(); }
public void onAddAOEPorp() { if (SettingManager.Instance.TotalDiamond < 30) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-30); GameData.Instance.AddAoe(1); MTAManager.DoEvent(MTAPoint.MINI_BUY_AOE); labelAOE.text = SettingManager.Instance.TotalAoe.ToString(); #if US_VERSION DialogManager.Instance.PopupFadeOutMessage("Buy this item success"); #else DialogManager.Instance.PopupFadeOutMessage("购买AOE成功"); #endif }
public void onAddJiatelinPorp() { if (SettingManager.Instance.TotalDiamond < 25) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-25); GameData.Instance.AddJiatelin(1); MTAManager.DoEvent(MTAPoint.MINI_BUY_JIATELIN); labelJiatelin.text = SettingManager.Instance.TotalJiatelin.ToString(); #if US_VERSION DialogManager.Instance.PopupFadeOutMessage("Buy this item success"); #else DialogManager.Instance.PopupFadeOutMessage("购买加特林成功"); #endif }
public void onAddBindongProp() { if (SettingManager.Instance.TotalDiamond < 25) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-25); GameData.Instance.AddBindong(1); MTAManager.DoEvent(MTAPoint.MINI_BUY_BINDONG); labelBindong.text = SettingManager.Instance.TotalBindong.ToString(); #if US_VERSION DialogManager.Instance.PopupFadeOutMessage("Buy this item success"); #else DialogManager.Instance.PopupFadeOutMessage("购买冰冻成功"); #endif }
public void onGoldDouble() { if (SettingManager.Instance.TotalDiamond < 10) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-5); GameData.Instance.goldDouble = true; btnGoldDouble.gameObject.GetComponent <Collider>().enabled = false; btnGoldDouble.spriteName = disableSpriteName; MTAManager.DoEvent(MTAPoint.MINI_BUY_GOLD_DOUBLE); #if US_VERSION DialogManager.Instance.PopupFadeOutMessage("Buy double gold success!"); #else DialogManager.Instance.PopupFadeOutMessage("购买金币加倍成功"); #endif }
public void onAddBulletCapcity() { if (SettingManager.Instance.TotalDiamond < 20) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-20); GameData.Instance.bulletCapacity = 1.5f; btnBulletCapacity.gameObject.GetComponent <Collider>().enabled = false; btnBulletCapacity.spriteName = disableSpriteName; MTAManager.DoEvent(MTAPoint.MINI_BUY_BULLET_CAPCITY); #if US_VERSION DialogManager.Instance.PopupFadeOutMessage("Buy this item success"); #else DialogManager.Instance.PopupFadeOutMessage("购买装弹量增加50%成功"); #endif }
public void OnWeaponAddtional() { #if US_VERSION if (SettingManager.Instance.TotalDiamond < 200) { NotEnoughDiamondDialog.Popup(); return; } SettingManager.Instance.WeaponAddtional = 1; MTAManager.DoEvent(MTAPoint.MINI_BUY_VIP_TYPE_2); DialogManager.Instance.PopupFadeOutMessage("Buy this item success!", Vector3.zero, 3); WeaponAddtionalObj.collider.enabled = false; weaponDoneObj.SetActive(true); #else SettingManager.Instance.WeaponAddtional = 1; DialogManager.Instance.PopupFadeOutMessage("购买成功", Vector3.zero, 3); WeaponAddtionalObj.collider.enabled = false; weaponDoneObj.SetActive(true); #endif }
public void OnBuyGoldAddtion() { #if US_VERSION if (SettingManager.Instance.TotalDiamond < 100) { NotEnoughDiamondDialog.Popup(); return; } SettingManager.Instance.GoldAddtional = 1; MTAManager.DoEvent(MTAPoint.MINI_BUY_VIP_TYPE_1); DialogManager.Instance.PopupFadeOutMessage("Buy this item success!", Vector3.zero, 3); GoldAddtionalObj.GetComponent <Collider>().enabled = false; goldDoneObj.SetActive(true); #else SettingManager.Instance.GoldAddtional = 1; DialogManager.Instance.PopupFadeOutMessage("购买成功", Vector3.zero, 3); GoldAddtionalObj.GetComponent <Collider>().enabled = false; goldDoneObj.SetActive(true); #endif }
void MTAUpgradePoint() { switch (type) { case Type.Call: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_FU_ZHAOHUAN); break; case Type.Fury: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_FU_KUANGBAO); break; case Type.Restore: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_FU_HUIFU); break; case Type.Speed: MTAManager.DoEvent(MTAPoint.MINI_UPGRADE_FU_SPEED); break; } }
public void onDiamondAddtional() { if (SettingManager.Instance.TotalDiamond < 10) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-10); if (SettingManager.Instance.DiamondJiacheng == 0) { SettingManager.Instance.DiamondJiacheng = 1; } GameData.Instance.daojuDiamondAdditional = true; btnDiamondAdditional.gameObject.GetComponent <Collider>().enabled = false; btnDiamondAdditional.spriteName = disableSpriteName; MTAManager.DoEvent(MTAPoint.MINI_BUY_DIAMOND_PERCENT_20); #if US_VERSION DialogManager.Instance.PopupFadeOutMessage("Buy this item success!"); #else DialogManager.Instance.PopupFadeOutMessage("购买有概率获得20钻石成功"); #endif }
public void OnDropGunPorp() { if (gunFreezed) { return; } if (SettingManager.Instance.TotalJiatelin <= 0) { return; } SettingManager.Instance.UseDaojuTime += 1; SettingManager.Instance.DaojuCost_Shuaxin += 1; float duration = IOHelper.GetItemInfoById(4).cd_time; StartCoroutine(dropGunCD(duration)); StartCoroutine(PlayDropGunEffect()); GameData.Instance.AddJiatelin(-1); MTAManager.DoEvent(MTAPoint.MINI_USE_JIATELIN); jiatelinLabel.text = SettingManager.Instance.TotalJiatelin.ToString(); }
public void OnBindongProp() { if (bindongFreezed) { return; } if (SettingManager.Instance.TotalBindong <= 0) { return; } SettingManager.Instance.UseDaojuTime += 1; SettingManager.Instance.DaojuCost_Shuaxin += 1; float duration = IOHelper.GetItemInfoById(2).cd_time; StartCoroutine(bindongCD(duration)); StartCoroutine(PlayBindongEffect()); GameData.Instance.AddBindong(-1); MTAManager.DoEvent(MTAPoint.MINI_USE_BINDONG); bindongLabel.text = SettingManager.Instance.TotalBindong.ToString(); }
public void OnBuy(GameObject item) { int index = int.Parse(item.name); #if US_VERSION switch (index) { case 3: if (SettingManager.Instance.TotalDiamond < 70) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-70); GameData.Instance.AddBindong(2); GameData.Instance.AddJiaxue(3); MTAManager.DoEvent(MTAPoint.MINI_BUY_SALE_TYPE_3); DialogManager.Instance.PopupFadeOutMessage("Buy this item success!", Vector3.zero, 3); break; case 4: //3 AOE + 3 jiatelin 8yuan if (SettingManager.Instance.TotalDiamond < 80) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-80); GameData.Instance.AddAoe(3); GameData.Instance.AddJiatelin(3); MTAManager.DoEvent(MTAPoint.MINI_BUY_SALE_TYPE_4); DialogManager.Instance.PopupFadeOutMessage("Buy this item success!", Vector3.zero, 3); break; case 5: //3 jiaxue + 2000 gold 6yuan if (SettingManager.Instance.TotalDiamond < 60) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-60); GameData.Instance.AddJiaxue(3); GameData.Instance.AddGold(2000); MTAManager.DoEvent(MTAPoint.MINI_BUY_SALE_TYPE_5); DialogManager.Instance.PopupFadeOutMessage("Buy this item success!", Vector3.zero, 3); break; case 6: //2 AOE + 4000 gold 8yuan if (SettingManager.Instance.TotalDiamond < 80) { NotEnoughDiamondDialog.Popup(); return; } GameData.Instance.AddDiamond(-80); GameData.Instance.AddAoe(2); GameData.Instance.AddGold(4000); MTAManager.DoEvent(MTAPoint.MINI_BUY_SALE_TYPE_6); DialogManager.Instance.PopupFadeOutMessage("Buy this item success!", Vector3.zero, 3); break; } #else switch (index) { case 1: //50 diamonds + 2500 gold 6yuan GameData.Instance.AddGold(2500); GameData.Instance.AddDiamond(50); DialogManager.Instance.PopupFadeOutMessage("2500金币和50钻石购买成功", Vector3.zero, 3); break; case 2: //100 diamonds + 5000 gold 10yuan GameData.Instance.AddGold(5000); GameData.Instance.AddDiamond(100); DialogManager.Instance.PopupFadeOutMessage("5000金币和100钻石购买成功", Vector3.zero, 3); break; case 3: //2 bindong + 3 jiaxue 7yuan GameData.Instance.AddBindong(2); GameData.Instance.AddJiaxue(3); DialogManager.Instance.PopupFadeOutMessage("冰霜星星*2和急救箱*3购买成功", Vector3.zero, 3); break; case 4: //3 AOE + 3 jiatelin 8yuan GameData.Instance.AddAoe(3); GameData.Instance.AddJiatelin(3); DialogManager.Instance.PopupFadeOutMessage("原子弹*3和加特林*3购买成功", Vector3.zero, 3); break; case 5: //3 jiaxue + 2000 gold 6yuan GameData.Instance.AddJiaxue(3); GameData.Instance.AddGold(2000); DialogManager.Instance.PopupFadeOutMessage("急救箱*3和2000金币购买成功", Vector3.zero, 3); break; case 6: //2 AOE + 4000 gold 8yuan GameData.Instance.AddAoe(2); GameData.Instance.AddGold(4000); DialogManager.Instance.PopupFadeOutMessage("原子弹*2和4000金币购买成功", Vector3.zero, 3); break; } #endif }