I have been trying to figure this out for days and asked around on the forums with only limited success.
I currently have an editor set up that allows me to create an instance of a ScriptableObject and then store that object to an asset file. This ScriptableObject has another list of ScriptableObjects inside it like:
</p>
```
[Serializable]
public class ContainerScriptableObject : ScriptableObject
{
public string packageName = "[Empty Package]";
public string createdOn = DateTime.Today.ToLongDateString();
public string notes = "";
public List<ChildScriptableObject> packageAssets;
}
```
<p>
The child ScriptableObject and all other objects under it are set up like:
</p>
```
[Serializable]
public class ChildScriptableObject : ScriptableObject, IChildScriptableObject
{
public string guid;
public string experimentName;
public string description;
public List<ChildChildScriptableObject> assetMaterials;
}
```
<p>
Everything works as expected, I have custom editors set up so that the inspector provides a nice interface to edit the properties.
My problem is that when I close and reopen the editor, the list of child scriptable objects have been replaced with null values. It still retains the correct number of items in the list but they are just empty.
Strangely, all the string variables in the ContainerScriptableObect class are retained between editor shut downs, but just not the child list objects.
I have also tried to use EditorUtility.SetDirty(ContainerScriptableObject) to signal to the editor to save the list data, but as I mentioned earlier the string data seems to save and update fine. Any advice on this matter would be greatly appreciated.