Example #1
0
        public static void SaveGeneralProgress()
        {
            //level progress
            PlayerPrefs.SetInt("TDTK_HighestLvlID", GameControl.GetHighestLevelID());

            //resource
            List <int> rscList = RscManager.GetCachedList();

            PlayerPrefs.SetInt("TDTK_RscCount", rscList.Count);
            for (int i = 0; i < rscList.Count; i++)
            {
                PlayerPrefs.SetInt("TDTK_Rsc_" + i, rscList[i]);
            }

            //Perk
            PlayerPrefs.SetInt("TDTK_PerkRsc", PerkManager.GetCachedRsc());
            List <int> perkList = PerkManager.GetCachedPurchasedIDList();

            PlayerPrefs.SetInt("TDTK_PerkCount", perkList.Count);
            for (int i = 0; i < perkList.Count; i++)
            {
                PlayerPrefs.SetInt("TDTK_PerkID_" + i, perkList[i]);
            }
        }