ScriptableObject created from custom editor lose data on Unity restart

Well title says it all, i am creating a custom Node Editor i am adding my custom node windows and trying to save their info to a ScriptableObject created as asset. After hour of searching i get Unity doesn’t like to serialize custom classes so i stripted it out of any and still nothing happens
NodeDataContainer class looks like this after the striping…
public class NodeDataContainer : ScriptableObject {

    //public List<BaseNode> windows = new List<BaseNode>();
    //public List<NodeDialogueDataContainer> dialoguesWindows = new List<NodeDialogueDataContainer>();
    //public List<NodeResponseDataContainer> responseWindows = new List<NodeResponseDataContainer>();
    public string dataBaseName;
    public DialogDataBase dataBaseReference;}

And here is how i am trying to Save to it from the NodeEditor class

void SaveDrawings()
        SerializedObject so;       //Second try with serializedObject instead
        if (dataBase== null)

        NodeDataContainer nc ;
        ScriptableObjectUtility.CreateAsset<NodeDataContainer>(".save",out nc);  //creates Asset and returns a reference of it
        so = new SerializedObject(nc);      //creating the SerializedObject?
        nc.dataBaseName =;    
        so.FindProperty("dataBaseName").stringValue =;
        nc.dataBaseReference = dataBase;
        so.FindProperty("dataBaseReference").objectReferenceValue = dataBase;
        /*for(int i = 0; i < windows.Count; i++)

if (windows*.GetType() == typeof(DialogueNode))*
DialogueNode dn = (DialogueNode)windows*;*
nc.dialoguesWindows.Add(new NodeDialogueDataContainer(, dn.dialogueID, dn.windowRect, dn.dialogue));
else if (windows*.GetType() == typeof(ResponseNode)) //obsolete*
ResponseNode rn = (ResponseNode)windows*;*
nc.responseWindows.Add(new NodeResponseDataContainer(, rn.responseID, rn.windowRect, rn.dialogue, rn.dialogueResultID));
Well lets ignore the lists for start (commended out) so I did try to use SerializedObject with FindProperty to make changes, nothing happend, if not use the SerializedObject everything seem to register properly until i restart Unity then the NodeDataContainer Asset is reseted. From SerializedObject.Update() to AssetDatabase.SaveAssets() nothing seem to work and i don’t get what am i missing. Also i should note that i tried EditorUtility.SetDirty(nc) which would corrupt the Asset and make it inaccessible, also tried to add inside OnEnable of DataContainer hideFlag = HideFlags.hideanddontsave which would prevent Asset from being created. If you need more info please let me know.
Any Insight on whats going wrong or what i am missing would be appreciated.
Note1: What i don’t really get is why would Unity save the data of the Asset if i manipulate them from inspector while it won’t through script.
Note2: Any insight on how i can save lists with the custom classes too would be great!
Note3:I know i could easily save the data directly on disc avoiding the whole thing of the Asset creation but i really want to figure this out…
here is how i create the assets if it matters
public static void CreateAsset(string name, out T asset) where T : ScriptableObject
string path = “Assets/Editor/NodeEditorSaveFiles”;
asset = ScriptableObject.CreateInstance();
AssetDatabase.CreateAsset(asset, path + “/” + name + “.asset”);
Selection.activeObject = asset;

EditorUtility.SetDirty(object.asset) did the trick, did use it but didn’t seem to work not sure what changed.