Doraku / DefaultEcs

Entity Component System framework aiming for syntax and usage simplicity with maximum performance for game development.
MIT No Attribution
658 stars 62 forks source link

mark entity as serializable #84

Closed neronmoon closed 4 years ago

neronmoon commented 4 years ago

In Unity structures and classes should be serializable in order to be shown in inspector

neronmoon commented 4 years ago

That's doest work

Doraku commented 4 years ago

To make it works you should just need to add a reference to the correct package to enable the SerializableAttribute for netstandard 1.1. Or maybe you mean that even with the attribute it does not behave as expected in unity? Anyway while it doesn't hurt this decoration is probably not correct, as even if you serialize an Entity, its context (components) is not saved, and can even lead to error (deserializing an Entity from a World which does not exist). That's why the ISerializer interface is provided to handle the serialization correctly.