コード例 #1
0
 void Load()
 {
     if (GeneratedItems > 0)
     {
         IdleItem[] TempItems = new IdleItem[Main.Items.Length];
         System.Array.Copy(Main.Items, TempItems, Main.Items.Length);
         Main.Items = new IdleItem[InitialLength + GeneratedItems];
         System.Array.Copy(TempItems, Main.Items, TempItems.Length);
         for (int i = InitialLength; i < InitialLength + GeneratedItems; i++)
         {
             Main.Items[i]            = (IdleItem)Instantiate(Main.Items[i - 1], Main.Items[i - 1].transform.position, Main.Items[i - 1].transform.rotation);
             Main.Items[i].InitialHP  = saver.LoadDecimal(i.ToString() + "HP");
             Main.Items[i].HP         = Main.Items[i].InitialHP;
             Main.Items[i].Toughness  = saver.LoadDecimal(i.ToString() + "Armor");
             Main.Items[i].PriceScore = saver.LoadDecimal(i.ToString() + "PS");
             Main.Items[i].Price      = saver.LoadDecimal(i.ToString() + "Price");
         }
     }
 }
コード例 #2
0
    void Load()
    {
        eSave loader = new eSave();

        if (loader.isSaved("MaxLevel"))
        {
            if (OnLoad != null)
            {
                OnLoad();
            }
            DateTime LastPlayDay = loader.LoadDateTime("LastPlayTime");
            Money            = loader.LoadDecimal("Money");
            MoneyMultiplier  = loader.LoadDecimal("MoneyM");
            Score            = loader.LoadDecimal("Score");
            TapPerSec        = loader.LoadFloat("TPS");
            IdleMoneyPerSec  = loader.LoadDecimal("IdleMoney");
            DamageMultiplier = loader.LoadDecimal("DamageM");
            CurrentItem      = loader.LoadInt("CurItem");
            Damage           = loader.LoadDecimal("Damage");
            MaxLevelUnlocked = (loader.LoadInt("MaxLevel"));
            if (PlayerPrefs.GetInt("GI") > 0)
            {
                MaxLevelUnlocked = Items.Length - 1;
            }
            TimeSpan TotalTime = DateTime.Now - LastPlayDay;
            TotalSec = (decimal)TotalTime.TotalSeconds;
            MoneyGot = (TotalSec * IdleMoneyPerSec * util.ConvertToDecimal(Items[CurrentItem].RewardPrice) / 2);
            Money   += MoneyGot;;
            if (MoneyGot > 0.000001m)
            {
                MoneyGotText.text = BigNumber.ShortNumber(MoneyGot);
            }
        }
    }
コード例 #3
0
    public void Load()
    {
        eSave Saver = new eSave();

        if (!Saver.isSaved("Money"))
        {
            return;
        }
        for (int i = 0; i < Variables.Length; i++)
        {
            if (Variables[i].Save)
            {
                Variables[i].Value       = Saver.LoadDecimal(Variables[i].Name + GetInstanceID());
                Variables[i].ValueOnLoad = Variables[i].Value;
            }
        }
    }