public void AddMoney(StdBigNumber _amount) { money += _amount; ui.UpdateMoneyText(MoneyTools.GetFormatedMoneyText(money), MoneyTools.GetScaleName(money)); if (onMoneyChanged != null) { onMoneyChanged(); } }
public void AddMoney(string _amount) { StdBigNumber number = new StdBigNumber(_amount); money += number; ui.UpdateMoneyText(MoneyTools.GetFormatedMoneyText(money), MoneyTools.GetScaleName(money)); if (onMoneyChanged != null) { onMoneyChanged(); } }
void Awake() { instance = this; //Set instance to this, so that you can access this script from anywhere MoneyTools.LoadScales(); //Load scales (number names like Million, Trillion, ect..) from xml file money = MoneyTools.LoadMoney(); //Load saved amount of money from binary file //Prepare everything for UI ui.UpdateMoneyText(MoneyTools.GetFormatedMoneyText(money), MoneyTools.GetScaleName(money)); LoadBusinessInfoAndSetupUI(); LoadManagersAndSetupUI(); LoadUpgradesAndSetupUI(); AddMoney(0); //Just to activate all listening buttons, waiting for a change }
public void ShowStartUpScreen() { startUpWindow.SetActive(!startUpWindow.activeSelf); if (startUpWindow.activeSelf) { TimeSpan t = TimeTools.TimeSpentOffline(); timeSpentOffline.text = Mathf.Floor((float)t.TotalHours) + "h " + t.Minutes + "m " + t.Seconds + "s"; BigNumber.StdBigNumber earnedOffline = GameManager.instance.HowMuchEarnedOffline(); earnedWhileOffline.text = MoneyTools.GetFormatedMoneyText(earnedOffline) + " " + MoneyTools.GetScaleName(earnedOffline); } }