Fixed reset progress

This commit is contained in:
Pasha Bibko
2026-05-05 11:42:09 +01:00
parent 528ed9f413
commit 670b8e3473
2 changed files with 11 additions and 2 deletions

View File

@@ -1,7 +1,5 @@
using PashaBibko.Pacore.Attributes; using PashaBibko.Pacore.Attributes;
using Fruitomation.Game;
using UnityEngine; using UnityEngine;
using UnityEngine.Rendering;
namespace Fruitomation.Global namespace Fruitomation.Global
{ {
@@ -13,6 +11,12 @@ namespace Fruitomation.Global
private double InternalCurrentMoney; private double InternalCurrentMoney;
public static double CurrentAmount => Instance.InternalCurrentMoney; public static double CurrentAmount => Instance.InternalCurrentMoney;
public static void ResetCurrentMoney()
{
Instance.InternalCurrentMoney = 0f;
PlayerInfo.Data.CurrentMoney = 0f;
}
public static void Add(double amount) public static void Add(double amount)
{ {
Instance.InternalCurrentMoney += amount; Instance.InternalCurrentMoney += amount;

View File

@@ -1,5 +1,6 @@
using System.IO; using System.IO;
using Fruitomation.Game; using Fruitomation.Game;
using Fruitomation.Global;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine; using UnityEngine;
@@ -21,7 +22,11 @@ namespace Fruitomation.UI
ResetButton.onClick.AddListener(() => ResetButton.onClick.AddListener(() =>
{ {
File.WriteAllText(BuildingManager.Filepath, ""); File.WriteAllText(BuildingManager.Filepath, "");
UpgradeManager.ResetUpgrades(); UpgradeManager.ResetUpgrades();
MoneyController.ResetCurrentMoney();
SceneController.StartLoadOf("GameScene");
}); });
} }
} }