|
I'm looing for solution how to serialize and de serialize binary data. I want to use BJON (Binary JSON), but i can change my decision, so i found that solution - http://james.newtonking.com/archive/2009/12/26/json-net-3-5-release-6-binary-json-bson-support.aspx . Is it works in unity or now? What you can recommend me for me?
(comments are locked)
|
|
Or if you are willing to decorate the objects you are serializing with attributes, and you're not serializing anything stored as just "object", you could try protobuf-net (Google Protocol Buffers). It is faster and serialized objects take up less space than using BinaryFormatter. protobuf-net is awesome! doesn't work on unity iOS though. edit: protobuf-net v2 beta is out. I've been using it on iOS and works fantastic.
Feb 24 at 04:27 PM
mindlube
(comments are locked)
|
|
You should look into the .NET-specific class BinaryFormatter (MSDN). It will binary-serialize any
(comments are locked)
|
|
Also if you want to serialize Unity objects you can try using ISerializationSurrogate http://msdn.microsoft.com/en-us/library/system.runtime.serialization.iserializationsurrogate.aspx I used it to serialize MonoBehaviours as they dont need to be created when you deserialize. You just serialize the name( or unique id ) of the game object that owns your MonoBehaviour script and then use GameObject.Find when you deserialize.
(comments are locked)
|
Unity Answers has moved to a new system, and some users may have trouble logging in.
If it requires 3.5, likely not yet. Why not try it?