JsonUtility cannot handle Dictionary<TKey,TValue>.
So we cannot save state into json file which contains Dictionary.
To avoid this issue, replace serialization dependency from JsonUtility to Json.NET, MessagePack-CSharp, ZeroFormatter, and so on...
What all we need is serialize object to byte[] and deserialize byte[] to object.
JsonUtility cannot handle
Dictionary<TKey,TValue>
. So we cannot save state into json file which contains Dictionary. To avoid this issue, replace serialization dependency from JsonUtility to Json.NET, MessagePack-CSharp, ZeroFormatter, and so on... What all we need is serializeobject
tobyte[]
and deserializebyte[]
toobject
.