Scriptable with List of Scriptables

Hello,

I have a little levels generator. Script creating scriptable (levels list) with list filled with scriptables (levels). Each level have also a list with scriptables. Almost everything works pretty well but after Unity restart, level scriptable is empty.

This is a level class:

public class LevelPanelsList : ScriptableObject
{
    public List<LevelPanel> lvlPanelsList = new List<LevelPanel>();
}

I using this line to save my assets when i creating them:
AssetDatabase.SaveAssets();

When I put everything manualy to the list, click ctrl+s and restart Unity it working but it’s not the way i would like to do this.
What I doing wrong?

Are you saving the Instances to assets? You need to save them to asset files, each one needs to be an asset for them to persist.
To create an asset use:

To append an object onto an existing asset you can also use

If the problem is that you are making changes in script and they are not saving then it could be because Unity does not know you have made changes.
you can use 1 of the following to make a change: