- Home /
Saving and Loading Various Things
Hello,
I'm most of the way through making a tower defense game. One of the last things I need to do is work on saving various things I'm using. I've looked into both player preferences and serialization and I've run into problems with both. Player preferences is editable by the user so it won't work for saving most of the things I need it to save. Serialization seems to be kind of what I need, but I'm running into the issue of the serialization persistent data path not existing. I also need to be able to save some things before building the game and still have them accessible after building. Any thoughts are appreciated.
Thanks
Answer by breban1 · Aug 07, 2016 at 01:22 PM
If you want to use Player Prefs but are worried about players editing the save data, you can use an asset like:
https://www.assetstore.unity3d.com/en/#!/content/32357
It's free and works basically just like Player Prefs, but it encrypts the data so it's not human readable.
Not exactly sure what you are asking with the part about saving some things before building.
Basically, I'm using a 2D array of lists to control which enemies do what when and I'm trying to figure out a way to construct that list and save it in such a way that I can access it in the game. Short term I'm creating that list every time I load the level but that's kind of taxing for a phone game so I'm hoping I can find a way to just include the lists in the files when I build the game. That asset is a step in the right direction but not exactly what I need.
Thanks