Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by RistoroMatteo · Feb 05, 2021 at 06:45 PM · scripting problemjson

SimpleJSON doesn't work

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:

alt text

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.

desktop-screenshot-20210205-19094395.png (233.1 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hellium · Feb 05, 2021 at 06:45 PM 0
Share

NuGet console is not supported in Unity out of the box.

https://github.com/GlitchEnzo/NuGetForUnity

Or download the source code of your package directly if possible.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · Feb 05, 2021 at 06:46 PM

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

 #define USE_SharpZipLib

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RistoroMatteo · Feb 05, 2021 at 07:37 PM 0
Share

Thank you so much for the updated file and extensions! now everything is easier. Forgive the ignorance, I didn't know what SharpZipLib was for, I thought it was necessary to make SimpleJSON work, I don't really need it. Thanks

avatar image RistoroMatteo · Feb 07, 2021 at 12:45 PM 0
Share

Hey, excuse me, I have a little problem, I'm trying to store two arrays, a bool [,] and an int [], but in both cases I get this error:

"it is not possible to implicitly convert from int[] (/ bool[, ]) to simpleJSON.JSONNode"

i searched online but all the solutions I found don't work with this library, how can i store this type of arrays? @Bunny83

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

208 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Storing levels data 1 Answer

Problem with jsonconstructor while deserializing a class 0 Answers

JsonData to texture? 0 Answers

3D Walk animation script errors 1 Answer

How to Shot An Object Toward Mouse's Position 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges