|
I've encountered a problem with Unity 3.5. So far I could write script that worked in editor and manipulated the values of its members (this is List actually). And after launching play mode the List data remained. But since I've installed Unity 3.5 that trick is over. Each time list is filled by script in editor mode and I start play mode the list data is erased and the count of list members goes to 0. But if I manually fill the list by references in Inspector then it runs OK. Here is the script when the list _neighbors is filled in editor when I build the scene and set to empty each time I trigger play mode. I know that all the public members in scripts derived by MonoBehaviour are serialized and it worked before. I have no idea what is happened. Maybe I'm doing something wrong and I should go another way. Hope someone could help me with this. Thanks.
(comments are locked)
|
|
Add some Debug.Log. I'm pretty sure the culprit is
(comments are locked)
|
|
This seems to have fixed it I added if (GUI.changed) EditorUtility.SetDirty(target); To the OnInspectorGUI
(comments are locked)
|
|
If you have a list that is containing classes you need to add [System.Serialize] on top of your class like this : [System.Serialize] public List Neighbors { get variables are standard serializable but classes aren't even if you set public infront you need to add this on top to let your list remember its class variables. hope it helps
(comments are locked)
|

I have this problem too.. looking for answere as well