Only to me can similar problems happen:
Some time ago I downloaded SimpleJSON.cs and used it with visual studio for a small project (without unity), obviously I installed the necessary package (Install-Package ICSharpCode.SharpZipLib.dll in the NuGet console) and everything worked correctly.
Today I decided to use it within another project, this time a unity project, and this happened:
I tried to search online but found nothing. I’m not an experienced programmer and this script is too complex for me, I can’t figure out what’s wrong.
Please help me.
Well, that looks like you have a very old version of SimpleJSON. The SharpZipLib is not required at all, only when you want to use the compressed binary serialization option which was just an “experiment”. When you comment out the line
You don’t need the SharpZipLib, Though of course you loose the compression function.
Note that the most recent version which has a lot of bugfixes and feature additions can be found on github. It’s not split into several files. The SimpleJSON.cs file is the main file. The other files are extension files. The binary serialization is now also in a seperate extention file. There’s also an extention specifically for Unity to provide easy support for reading Vectors, Quaternions, Color and some other Unity types from json.
If you really want to use the compression for the binary format, it’s hard to tell what’s wrong in your project. Are you sure you have the SharpZipLib in your project?
Note that the binary format does not have a version identifier. This was a huge oversight as it makes any modifications on the format difficult without breaking existing serialized data. I would not recommend to use the binary format, at least not for data storage. It may be useful for network transfer.