Fixed reset progress
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user