Difference between ScriptableObject and Serializable

I want to use ScriptableObject to save data.
To the class DataUnit, whether [System.Serializable] is the same as to inherit ScriptableObject.

 public class DataGroup : ScriptableObject
 {
     public string GroupName;
     public DataUnit[] Units;
 }


 [System.Serializable]
 public class DataUnit
 {
     public string UnitName;
     public QuestionBase[] Questions;
 }


 public class DataUnit : ScriptableObject
 {
     public string UnitName;
     public QuestionBase[] Questions;
 }

Hi @Minarstilis! Adding the SerializableAttribute to a custom class means that its (serializable) fields can be serialized and deserialized, and it is required for any custom classes that do not inherit from UnityEngine.Object if they need to do so. However, references to them will not survive a domain reload.

In contrast, things that inherit from UnityEngine.Object (such as ScriptableObject) will automatically serialize any of their serializable fields, and references to them (i.e. their managed wrapper) will survive a domain reload. That said, these types of objects typically exist as persistent assets in your project.