Esempio n. 1
0
    public static void LoadDataLevel()
    {
        if (PlayerPrefs.HasKey("_level"))
        {
            _level = System.Int32.Parse(TestLeaderBoard.DecryptString(PlayerPrefs.GetString("_level"), "key"));
        }
        else
        {
            _level = 0;
        }
        if (PlayerPrefs.HasKey("campainNow"))
        {
            campainNow = System.Int32.Parse(TestLeaderBoard.DecryptString(PlayerPrefs.GetString("campainNow"), "key"));
        }
        else
        {
            campainNow = 0;
        }

        _star = new List <int>();
        _star.Clear();
        for (int i = 0; i < _level; i++)
        {
            if (PlayerPrefs.HasKey("_star" + i))
            {
                _star.Add(System.Int32.Parse(TestLeaderBoard.DecryptString(PlayerPrefs.GetString("_star" + i), "key")));
                //print(i+"   "+_star[i]);
            }
            else
            {
                _star.Add(0);
            }
        }
    }
Esempio n. 2
0
 public static List <int> _star = new List <int>(); // danh sach star hien co moi level
 public static void Save_Star()
 {
     for (int i = 0; i < _star.Count; i++)
     {
         PlayerPrefs.DeleteKey("_star" + i);
         PlayerPrefs.SetString("_star" + i, TestLeaderBoard.EncryptString(_star[i].ToString(), "key"));
         PlayerPrefs.Save();
     }
 }
Esempio n. 3
0
 public static int campainNow = 0;//capain hien tai
 public static void SaveCampainNow()
 {
     PlayerPrefs.SetString("campainNow", TestLeaderBoard.EncryptString(campainNow.ToString(), "key"));
     PlayerPrefs.Save();
 }
Esempio n. 4
0
 public static int _level;//nhiem vu hien co cao nhat
 public static void Save_Level()
 {
     PlayerPrefs.SetString("_level", TestLeaderBoard.EncryptString(_level.ToString(), "key"));
     PlayerPrefs.Save();
 }