Question by
softrare · Feb 16, 2016 at 10:09 AM ·
serializationjsonxmldictionarynested
Nested dictionary serialization
Hi! I want to serialize a nested dictionary in the fastest (performance) way possible. Here is my declaration:
public class ExampleClass {
public Dictionary<string, Dictionary<string, float>> nestedDicts = new Dictionary<string, Dictionary<string, float>>();
}
It could be JSON, XML, or binary, I don't mind, as long as it is performant and platform-independent.
I am looking for something like:
ExampleClass ec = new ExampleClass();
//encode
var encoded = Serialize(ec);
//decode
ExampleClass ec2 = Deserialize(encoded);
I am looking for something that comes with MIT license or similar because it will be part of an asset for the Asset Store.
I tried FastJSON but it keeps crashing Unity. Anyone knows an alternative (or how the crashes can be resolved)?
Comment