I have 6 save game files that are created using C# serialization. I need these files to be included in my build. With a PC version, I can simply copy/paste the needed files into the final build folder. Under Android, due to it packing everything into a *.apk file, I am unable to include the needed game save files. I tried placing them in the Assets/Resources/saves folder and even added a new JS file with the following code:
But Unity is still not packing my save files into the build...
How can I tell Unity that these files are required and make them part of the build??
I got them working under Android. The problem was resolved when I imported them in the Editor, instead of copying them into the directory.
Sounds like Occam's Razor!! The best answer is the most obvious... Thanks!!
I'm not developing for Android, so bear with me if this doesn't help you, but I did a quick google to try and find a solution for you.
According to this question on how to save and read data on android, you can either use PlayerPrefs to store the variables that define a saved game, or if the data you need included is unsuitable for PlayerPrefs, you can store the files on the SD card and read/write using Application.persistentDataPath. I think that's the way to do this - you don't need the data embedded in the Unity build.
answered Nov 02 '11 at 07:48 AM