using PashaBibko.Pacore.Attributes; using Fruitomation.Game; using UnityEngine; namespace Fruitomation.Global { [CreateInstanceOnStart] public class MoneyController : MonoBehaviour { private static MoneyController Instance; [SerializeField, InspectorReadOnly("Current Money")] private double InternalCurrentMoney = new(); public static double Current => Instance.InternalCurrentMoney; public static void Add(double amount) { Instance.InternalCurrentMoney += amount; } private void Awake() { if (Instance is not null) { Debug.LogError("Cannot have multiple instances of [MoneyController]"); return; } Instance = this; } } }