- Home /
Losing serialized data after play button pressed.
Hello,
I hope whoever read this mind my bad English..
I got a problem while making a map editor.
Before I started making the map editor, I carefully read about serialization in unity3d.
from this:
http://docs.unity3d.com/Documentation/ScriptReference/SerializeField.html
My custom classes works good except if I press the "PLAY" button.
After play mode, some of serialized data are broken.
For example, I put tile data into tile list, and then some of those, not all of them, become NULL
after play mode. I tried to figure out, but I still don't understand why it randomly happens.
I hope anybody know what my mistake or problem is....
Thanks for all who read this.
How are you editing your data in your map editor?
This sounds like you're not telling Unity to save your editor changes.
I suggest you use EditorUtility.SetDirty();
http://docs.unity3d.com/Documentation/ScriptReference/EditorUtility.SetDirty.html
if you have a custom inspector you may also which to check for GUI.Changed as they do in the above example.
If this is indeed what's wrong, I'll convert to an answer.
Your answer
Follow this Question
Related Questions
OnSerialize event 2 Answers
Unity Editor SerializedProperty how to assign to array with larger data directly. 1 Answer
Outsource EditorWindow code 1 Answer
Unity3D Serialization Bug 0 Answers