Serializing procedurally created objects

Hi,

I have an object that contains a List<> of custom objects derived from ScriptableObject. In my custom editor, I have an interface to create instances of these custom objects procedurally and adding them to the List<>.

It doesn’t seem as though this data is saving, am I missing something? Is it not possible to save references to procedurally created objects? I tried converting my custom object to a value type, but it doesn’t look like those save either :(.

Are you using a System.Collections.Generic.List? I only ask- because it’s one of the only ‘lists’ that unity will serialize. That said, if you’re using a list of lists, unity won’t serialize that either.

No dictionaries, no jagged lists, no lists of unserializable data.

Also verify that your custom objects are using the System.Serializable() keyword.

And lastly, go through and make sure that all of your variables that need to be serialized are marked as such (and are capable of serialization).

Found the problem, I need to call EditorUtility.SetDirty().