public void SetNewActivity(string activityText) { for (int i = saveData.playerLatestActivities.Count - 1; i >= 1; i--) { saveData.playerLatestActivities[i] = saveData.playerLatestActivities[i - 1]; } saveData.playerLatestActivities[0] = activityText; gsl.Save(); }
private void TimeManagment() { timeLeft -= Time.fixedDeltaTime; timeLeftText.text = timeLeft.ToString("#.##"); if (timeLeft <= 0f) { if (score > 0) { if (isFabrika) { string kreditText = ""; gameplay.KreditManager(ref score, ref kreditText); sd.playerMoney += score; sd.playerHealth -= 0.1f; sd.playerHunger -= 0.1f; sd.playerThirst -= 0.1f; sd.playerHappiness -= 0.1f; gameplay.SetNewActivity(sd.playerName + " se vraća sa posla u fabrici. Zaradio je " + score.ToString("#.##") + "KM." + kreditText); } else { sd.playerMoney -= 25f; sd.playerHealth += 0.2f; sd.playerHunger += 0.15f; sd.playerThirst += 0.15f; gameplay.SetNewActivity(sd.playerName + " kupuje domaće namirnice. Svaka čast!"); } } else { if (isFabrika) { sd.playerMoney += score; sd.playerHealth -= 0.1f; sd.playerHunger -= 0.1f; sd.playerThirst -= 0.1f; sd.playerHappiness -= 0.1f; gameplay.SetNewActivity(sd.playerName + " se vraća s posla u fabrici. Napravio je propust i morao platiti štetu od " + score.ToString("#.##") + "KM"); } else { sd.playerMoney -= 50f; sd.playerHappiness -= 0.1f; sd.playerHealth -= 0.15f; sd.playerHunger -= 0.05f; sd.playerThirst -= 0.1f; gameplay.SetNewActivity(sd.playerName + " se vraća iz prodavnice. Sljedeći put preporućujemo da kupujete domaće."); } } gsl.Save(); SceneManager.LoadScene("MainGame"); } }