Simple Save / Load

I was wondering if there is a way to duplicate a game objectthe player, save that duplicate to a file, then later on load that duplicate after the game has ended. I have sort of a deadline to meet tomorrow so I’m looking for the simplest way to do this, also the quickest way.

I just need to save the player’s info then retrieve it at a later date, so a duplicate of the player object would work for me.

Or you could use PlayerPrefs? http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html Depending on what you need/want to do, of course. You would want to take a look at serialization for more serious save/load though.

–

Going between different level/scenes or application loading?

–

@ BerggreenDK Application loading. Like turning off the game and coming back to play at a later time. and @ Asasfsitner, I'll check it out.

–

@ Asafsitner: I'm looking for more of a savetype similiar to the legend of zelda series, where your character info is saved and you resume.

–

I can't see why you can't do it with PlayerPrefs, then. SetString/Int/Float and then GetString/Int/Float. It's the simplest way of 'saving' Unity offers. p.s. I haven't played any of the Zelda titles, so I wouldn't know the details, but if it's something like HP, Level and equipment it's possible - though possibly ugly.

–

2 Answers

2

I would place all my hero/player data into a “data-class”. Thats a class used for structure without any code except for load and save function perhaps.

Because then you should be able to serialize it. If you are, its rather easy to load and save it through WWW or Player.Prefs in one go.

I just use EZSave. simple as that :stuck_out_tongue:

http://www.anbsoft.com/middleware/ezs/index.htm