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"); }); } }