JsonUtility strategies

So I’ve been playing with the relatively new JsonUtility class. Its fairly cool, you can hijack Unity’s own serialization system to save and load data at run time. You can serialize a MonoBehaviour direct to a json and back again. Its pretty nifty. You can also serialize scriptable objects and vanilla classes too.

Seems to have a bunch of flaws and limitations through. Can’t serialize any of the engine types. So things like GameObject, Transform, or RigidBody are out. I’ve taken to building out some token classes, to gather up the appropriate data. But its a bit of a pain. Its also not simple to deal with parent child relationships.

So I’m curious what strategies people have employed for using JsonUtility.

And of course I’ve put in a feedback request for extending it out.

I been using it in conjunction with ScriptableObjects a lot. It lets me assign bits of data to anything i want via inspector drag and drop that is also serializable at run time.

More or less lets me create scriptable objects, that on use will check persistent Data for a json file of the same name to read data from, and if it doesn’t exist they will write their current values to the json, than on changes they will rewrite to json.