From 670b8e347358998073339c4b46b7be7205f0a006 Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Tue, 5 May 2026 11:42:09 +0100 Subject: [PATCH] Fixed reset progress --- Assets/Scripts/Global/MoneyController.cs | 8 ++++++-- Assets/Scripts/UI/MainMenuController.cs | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Global/MoneyController.cs b/Assets/Scripts/Global/MoneyController.cs index 1688267..efb369a 100644 --- a/Assets/Scripts/Global/MoneyController.cs +++ b/Assets/Scripts/Global/MoneyController.cs @@ -1,7 +1,5 @@ using PashaBibko.Pacore.Attributes; -using Fruitomation.Game; using UnityEngine; -using UnityEngine.Rendering; namespace Fruitomation.Global { @@ -13,6 +11,12 @@ namespace Fruitomation.Global private double InternalCurrentMoney; public static double CurrentAmount => Instance.InternalCurrentMoney; + public static void ResetCurrentMoney() + { + Instance.InternalCurrentMoney = 0f; + PlayerInfo.Data.CurrentMoney = 0f; + } + public static void Add(double amount) { Instance.InternalCurrentMoney += amount; diff --git a/Assets/Scripts/UI/MainMenuController.cs b/Assets/Scripts/UI/MainMenuController.cs index 4445074..9a53e32 100644 --- a/Assets/Scripts/UI/MainMenuController.cs +++ b/Assets/Scripts/UI/MainMenuController.cs @@ -1,5 +1,6 @@ using System.IO; using Fruitomation.Game; +using Fruitomation.Global; using UnityEngine.UI; using UnityEngine; @@ -21,7 +22,11 @@ namespace Fruitomation.UI ResetButton.onClick.AddListener(() => { File.WriteAllText(BuildingManager.Filepath, ""); + UpgradeManager.ResetUpgrades(); + MoneyController.ResetCurrentMoney(); + + SceneController.StartLoadOf("GameScene"); }); } }