Ejemplo n.º 1
0
 public void AddMoney(StdBigNumber _amount)
 {
     money += _amount;
     ui.UpdateMoneyText(MoneyTools.GetFormatedMoneyText(money), MoneyTools.GetScaleName(money));
     if (onMoneyChanged != null)
     {
         onMoneyChanged();
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
    public void AddMoney(string _amount)
    {
        StdBigNumber number = new StdBigNumber(_amount);

        money += number;
        ui.UpdateMoneyText(MoneyTools.GetFormatedMoneyText(money), MoneyTools.GetScaleName(money));
        if (onMoneyChanged != null)
        {
            onMoneyChanged();
        }
    }
Ejemplo n.º 4
0
    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
    }
Ejemplo n.º 5
0
 //When player quits the game the current time is saved as well as amount of money
 //Next time the player opens the game, this data is persisted
 void Save()
 {
     TimeTools.SaveTime();                       //Save current time on exit
     MoneyTools.SaveMoney(money);                //Save money
 }