コード例 #1
0
ファイル: GameManager.cs プロジェクト: blacknik/cliker
 public void AddMoney(StdBigNumber _amount)
 {
     money += _amount;
     ui.UpdateMoneyText(MoneyTools.GetFormatedMoneyText(money), MoneyTools.GetScaleName(money));
     if (onMoneyChanged != null)
     {
         onMoneyChanged();
     }
 }
コード例 #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);
     }
 }
コード例 #3
0
ファイル: GameManager.cs プロジェクト: blacknik/cliker
    public void AddMoney(string _amount)
    {
        StdBigNumber number = new StdBigNumber(_amount);

        money += number;
        ui.UpdateMoneyText(MoneyTools.GetFormatedMoneyText(money), MoneyTools.GetScaleName(money));
        if (onMoneyChanged != null)
        {
            onMoneyChanged();
        }
    }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: blacknik/cliker
    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
    }
コード例 #5
0
ファイル: GameManager.cs プロジェクト: blacknik/cliker
 //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
 }