title: Serialize whole instance with child instances (class serialization) and save to file
body: <p>I'm building a game with Unity3D. I have a class called GameInstance containing all the current game instance data in it. It contains multiple sub classes for instance the <code>Player</code> property would return a <code>Player</code> object.</p>
  
  <p>Yet all objects are simple key/values objects, it's only data. Now I'd need to serialize all of this and save it to a file so I can reload it to restart the game where it left.</p>
  
  <p>That's what I basically intent to do, maybe somebody would have a better suggestion but yet that's the most flexible option I found.</p>
  
  <p>I used .NET XML object serialization in the past but it's been a while and I'd need to have a more direct advice on this. Should I serialize to XML or JSON for example?</p>
  
  <p><strong>TL;DR</strong>: I want to serialize a whole class with all its content with C#/.NET in a Unity3D project. How should I proceed?</p>
  
  <p>Thanks!</p>