- Home /
Saving/Loading Problems
So I went to this page, http://wiki.unity3d.com/index.php?title=Save_and_Load_from_XML and I understand how it works, but I need it to be set up differently for me. My Main menu and pause menu are on 2 different scenes, so when loading and saving they need to load and save just the 1 scene that you actually play on. So how would you change the script (java) from that link into something that would work on the other 2 scenes?
Just to let you know, this is not really a good way to do object serialization in my opinion. There are lots of built-in ways to do this in .NET.
can you be a bit more specific? Im not familiar with .NET
Answer by getyour411 · Sep 09, 2013 at 01:05 AM
One way is to change the _FileName parameter to use different XMLfiles to store different XML types per your scene requirements. Since the code is really just an example stub showing how to save one simple object type, you'll need to develop your own metadata structures and plug those into the script, if that sounds overly complicated just change the filename.
"...The guts of what you save is located in the UserData class, change this as you see fit to allow you to save what you want. You will also need to update the save method to store the information that you are looking to store. At the moment, the code is only setup to store the postition of the object in world space... "
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Accessing Functions from other Scripts 1 Answer
Save Player Health and stats 1 Answer
Saving and Loading 0 Answers
Saving frequently throughout game lifecycle (Android) 1 Answer