monogame

xml serializing of saved game data

♀尐吖头ヾ 提交于 2019-11-27 08:26:03
问题 I am trying to write a method to save some basing data for a game. At the moment I am trying to save data in an xml format with a parent <data> element containing an array of <leveldata> elements which have fields for index, completion and attempts. This is the first time I have tried to serialize anything in c# so I have run into a few issues, at the moment, it is falling over with an invalidoperationexception when I try to deserialize the file (detail of exception at bottom). Here is the