private void GameEnd(bool win) { StopCoroutine("Timer"); GameEndData gameEndData = new GameEndData(); gameEndData.win = win; gameEndData.finalScore = _receivedEnergy; gameEndData.needScore = _needEnergyToCompleteLevel; gameEndData.playerDie = false; if (win) { SaveSystem.SaveLevelStatucByID(GameEconomy.curentLevel.levelSaveLoadID, true); } else { //SaveSystem.SaveLevelStatucByID(GameEconomy.curentLevel.levelSaveLoadID, false); } GameEconomy.AddPlayerMoney(_receivedEnergy); if (GameEconomy.curentItem && GameEconomy.curentItem.itemName != "Empty") { GameEconomy.curentItem.bought = false; } SetPauseEnabled(); GameEconomy.SaveEconomy(); GameEnded(gameEndData); }
public void GiveMoney() { GameEconomy.AddPlayerMoney(9999); playerMoneyText.text = GameEconomy.GetPlayerMoney().ToString(); }