- Home /
Manually Save/Load Unity Serialization Data
Dealing with this problem.
Alright - So. All indications are that the serialization of the Scriptable Objects is fully functional. It saves to the scene, it is not stomped on play, it is the scene when it is loaded. All is well. But the SO serialization data is not stored with a prefab - because, apparently, they're part of the scene but not any objects.
So, clearly, all I need to do is save the serialization data to the Prefab, and then load from it at some appropriate point when instantiating the prefab.
Which means I need to know:
a) How can I access the Unity serializer so that I can, say, manually save the data as a member variable in the Monobehavior?
b) How can I access the Unity de-serializer so that I can, say, manually instantiate from the serialized data in the Monobehavior?
Note: I don't care that this will break references if the referenced objects aren't part of the prefab.