Esempio n. 1
0
    private void LoadPackages()
    {
        Vector3i[] loadPackages = PlayerPrefsX.GetVector3iArray("FrogPackages");
        packagesSaved.Clear();

        for (int i = 0; i < loadPackages.Length; i++)
        {
            if (loadPackages[i].x > 0)
            {
                //Debug.Log ("Loaded: " + loadPackages[i].ToString ());
                packagesSaved.Add(new Vector3i(loadPackages[i].x, loadPackages[i].y, loadPackages[i].z));
            }
        }

        for (int i = 0; i < frogPackages.Count; i++)
        {
            Frog     package      = frogPackages[i].GetComponent <Frog>();
            Vector3i savedPackage = packagesSaved.Find(x => x.x == package.id);

            if (savedPackage == Vector3i.zero)
            {
                //Debug.Log ("Added " + package.id + " with " + package.isUnlocked);
                packagesSaved.Add(new Vector3i(package.id, package.isUnlocked, package.canBuy));
            }
        }

        SavePackages();
    }