- Home /
Cross Platform Saving
This is kind of a lot to ask for, but is there anyway in Unity that I could somehow create a cross platform saving system? For example, I could progress in my Android app, and then save, go onto my Apple version, and somehow be at the same point I left off on? I'm making a language learning app, and this would be a very good feature I feel, although I have no idea how I would go about doing it, or if it's even possible. All versions will be on mobile (Windows Phone, Apple, and Android), please let me know if you have any suggestions!
Answer by lassade · Jan 17, 2016 at 05:58 AM
Yes you can do this, the first step is make sure all the platforms can load the data in the same way, to do this use a JSON or XML library. Assuming that your game logic is deterministic (behaves the same way in all platforms) you are good to go with just some lines.
Getting this can be tricky if you stumble upon code that does not work the same way: The serialization part is the simplest most libraries even binary ones (don’t recommend using them) will make sure to load you data as is there. But if yo u start by saving a seed for some random number generator you will need to make sure the random function works the same way in all platforms best way to be sure write your own based on some code on internet.
So finnly serialize using a text based format like JSON and XML even YAML (if you feel fancy), then load in all different version of you app, (for that put the saves file a server then use the WWW class to download then) see if works if not find the problem and fix it.