Hello friends,
why are structs like vector, vertexpositiontexture et cetera not marked as serializable?
It would be a great help.. espacially when saving exempli gratia vertex-chunks or something as bytes.
Is there a possiblity to "fix" it or do I need to recreate these structs marked as serializable?
Best regards,
net-d3v3l0p3r ( =
They're serializable in XNA, so I guess this was just overlooked. This should get implemented :) It's just a matter of adding the attribute.
yeah, one time I needed this so I had to edit the monogame source, a little annoying but also kind of fun. it would be nice if someone added this for real.
@NET-D3v3l0p3r @kameko If either of you would like to do this that would be very much appreciated :)
Done, as you said.. a few changes.. thank You ( =
The [Serializable] attribute is not available on all platforms, i.e. WinRT.
Check the history on this source files.
Ah you are right, you mean this https://github.com/MonoGame/MonoGame/commit/d04c27c595e9aa3c7e94d529f51a180b02c6d928, don't you?
Ah, so the alternative that was used is the DataContractAttribute which also makes the type serializable.
I don't think DataContract is a direct replacement though. It may not work
exactly the same. But Serializable is not available on all platforms, so
that can't be expected to work the same either.
Most helpful comment
The [Serializable] attribute is not available on all platforms, i.e. WinRT.
Check the history on this source files.