/// <summary> /// 开始按钮点击 /// </summary> void OnPlayButtonClicked() { //if (action == 0) //{ // action = 1; // ChangeUIDisplay(action); //} //else //{ if (selectScene != -1 && Player.CurrentPlayer.EquipedWeaponId != -1) { GameGlobalValue.s_CurrentScene = selectScene; GameGlobalValue.s_CurrentDifficulty = selectDifficulty; GameGlobalValue.s_currentWeaponId = Player.CurrentPlayer.EquipedWeaponId; if (GameGlobalValue.s_CurrentGameType == GameType.Story) { if (selectLevel == -1) { selectLevel = Player.CurrentPlayer.GetSceneCurrentLevel(selectScene); } GameGlobalValue.s_CurrentLevel = selectLevel; } AnalysticUtil.TrackEvent("Scene Start", new Dictionary <string, object>() { { "Scene Id", selectScene } }); GameLogic.Instance.Loading(); } else { Message.PopupMessage("Please select scene first !"); } // } }
public void OnWeaponEquiped() { if (selectWeaponId != -1) { Player.CurrentPlayer.EquipWeapon(selectWeaponId); SoundManager.Instance.PlaySound(SoundManager.SoundType.WeaponEqiuped); OnWeaponSelected(true, selectWeaponItem); AnalysticUtil.TrackEvent("Equiped Weapon", new Dictionary <string, object>() { { "Weapon ID", selectWeaponId } }); } }
public void OnWeaponUpgrade() { if (selectWeaponId != -1) { var wp = WeaponManager.Instance.GetCurrentPropertyById(selectWeaponId); if (wp != null) { if (wp.UpgPrice > 0) { if (Player.CurrentPlayer.Money >= wp.UpgPrice) { //Player.CurrentPlayer.UpgradeWeapon(selectWeaponId, -wp.UpgPrice); WeaponManager.Instance.WeaponUpgrade(selectWeaponId); SoundManager.Instance.PlaySound(SoundManager.SoundType.WeaponUpgrade); OnWeaponSelected(true, selectWeaponItem); AnalysticUtil.TrackEvent("Upgrade Weapon", new Dictionary <string, object>() { { "Weapon ID", selectWeaponId } }); } else { Message.PopupMessage("NOT ENOUGH CASH!", 2f); AnalysticUtil.TrackEvent("Want Upgrade Weapon", new Dictionary <string, object>() { { "Weapon ID", selectWeaponId } }); } } else { Message.PopupMessage("MAX", 2f); } } } else { Message.PopupMessage("PLEASE SELECT WEAPON FIRST!", 2f); } }
/// <summary> /// 购买武器 /// </summary> public void OnWeaponBuy() { //Player.CurrentPlayer.UseMoney(-10000); if (selectWeaponId != -1) { var wi = WeaponManager.Instance.GetWeaponItemById(selectWeaponId); if (!wi.Enabled()) { if (Player.CurrentPlayer.Money >= wi.Prices) { //Player.CurrentPlayer.UpgradeWeapon(selectWeaponId, -wp.UpgPrice); WeaponManager.Instance.WeaponBuy(selectWeaponId); SoundManager.Instance.PlaySound(SoundManager.SoundType.WeaponBought); OnWeaponSelected(true, selectWeaponItem); AnalysticUtil.TrackEvent("Buy Weapon", new Dictionary <string, object>() { { "Weapon ID", selectWeaponId } }); } else { Message.PopupMessage("NOT ENOUGH CASH!", 2f); AnalysticUtil.TrackEvent("Want Weapon", new Dictionary <string, object>() { { "Weapon ID", selectWeaponId } }); } } else { Message.PopupMessage("Bought!!!", 2f); } } else { Message.PopupMessage("PLEASE SELECT WEAPON FIRST!", 2f); } }