Saving Serialization with Lists

I’ve come across an issue with my save script, which probably has to do with my lack of understanding of serialization.

My class has a List that gets populated at runtime when a new player is created. However, saving causes an error (shortened for brevity):

[System.Serializable]
public class PlayerStats {

       // ...

    public List<SkillTree> trees = new List<SkillTree>();

       // ...

    // Use this for initialization
    public PlayerStats() {
       
      initSkillTrees();
    }      

    // ....

    private void initSkillTrees() {
       // create skill tree etc
       trees.Add(newlyCreatedSkillTreeObj);
    }

And I receive this error:

SerializationException: Type PlayerStats+<initSkillTrees>c__AnonStorey4E is not marked as Serializable.
System.Runtime.Serialization.Formatters.Binary.BinaryCommon.CheckSerializable (System.Type type, ISurrogateSelector selector, StreamingContext context) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs:119)
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs:386)

Which is confusing to me, since I thought serializing was on the fields and not the methods, but it is specifically telling me that the method is having a problem.
The SkillTree class also references a Skill class below it, but every class is marked as [System.Serializable].

Looks like some field inside of your serialized object graph is not marked as Serializable.

Thanks, yes this was the issue. It wasn’t a list problem, but a problem with Actions.
I was using a Skill class with an Action field, which gets populated in the method. Stuff in there wasn’t serializable. I will have to re-work this a bit.