public void DeleteAllData()
    {
        //Delete from the file system.
        FileFetch.ClearAllKeys();

        //Set the file version upon deleting.
        FileFetch.SetFloat("VERSION", FileVersion);

        //We have to delete the stats in memory.
        if (_gameStatistics)
        {
            DestroyObject(_gameStatistics.gameObject);
        }


        int index = 0;

        foreach (EntityFactory.CannonTypes type in _cannonSlots)
        {
            //Set to default cannons.
            ToyBox.GetPandora().AssignSlot(EntityFactory.CannonTypes.Zebra, index);

            index++;
        }


        LoadAllDataFromFileSystem();

        //Go through each card and recalculate the trophies earned

        //Recalculate trophies.
        CalculateTrophiesEarned();

        print("All Data Deleted :(((( ");
    }
    public void SaveToPlayerPrefs()
    {
        //Write the header to see if this stats is in the player prefs.
        //FileFetch.SetString(name,name);

        IDictionary save = new Dictionary <string, int>();

        //Write each data entry.
        foreach (DataEntry data in _statisticsEntries)
        {
            //data.WriteToPlayerPrefs(this.name);
            data.WriteToDictionary(save);
        }

        //Write the total time played.
        FileFetch.SetFloat(name + "_TotalTime", TimeAmount);

        //Write the score
        //FileFetch.SetInt(name + "_StatsScore", StatsScore);
        save.Add(name + "_StatsScore", StatsScore);

        //Save the multiplier as well.... just incase.
        //FileFetch.SetInt(name + "_Modifier", StatsValueModifier);
        save.Add(name + "_Modifier", StatsValueModifier);



        FileFetch.SetDictionary(name, save);


        //	print("Data Write Function Complete: " + this.name);
    }
    public void SaveAllData()
    {
        if (_gameStatistics != null)
        {
            //Save total game stats.
            _gameStatistics.SaveToPlayerPrefs();
        }

        //Set the version
        FileFetch.SetFloat("VERSION", FileVersion);

        //Save item card data.
        SaveItemCardData();

        //Save the options data.
        Options.Save();

        //Save some more of players data.
        FileFetch.SetInt("GEMBANK", _gemBank);

        //Save total XP earned.
        FileFetch.SetInt("TOTALXP", _totalXP);


        //Sync after we save.
        //SyncAllData();

        Debug.Log(Application.persistentDataPath + "/PlayerPrefs.txt");
    }
Example #4
0
 public void Save()
 {
     FileFetch.SetFloat("OPTIONS_SFX", SoundFXLevel);
     FileFetch.SetFloat("OPTIONS_MUSIC", MusicLevel);
 }