Let’s say, for example, this is my class…
public class DoodadData
{
public List<Color> colorVariations;
}
…and this is my XML data I’m deserializing…
<?xml version="1.0" encoding="utf-8" ?>
<XnaContent>
<Asset Type="Data.DoodadData">
<colorVariations>
<Item>
<R>0</R>
<G>0</G>
<B>0</B>
<A>0</A>
</Item>
</colorVariations>
</Asset>
</XnaContent>
Is there something I need to change to get this to work? The error that MSVC is giving me says…
“There was an error while deserializing intermediate XML. ‘Element’ is an invalid XmlNodeType. Line 20, position 5.”
Which is pointing me to the first “Item” tag in the colorVariations List. Everything I’ve found on Google tells me that naming the elements “Item” is correct when using IntermediateSerializer. I’ve also tried naming them “Element” and “Color” to no avail. (I’ve also tried other things, like renaming the RGBA properties, which also didn’t work).
After messing around with it, I’ve found that it seems like the colors need to be entered tag-less and in hex format, like so: