JSON libraries compatible with Android and IOS on Unity

Source: Internet
Author: User

It is easy to say that a tool class written in C # to parse JSON can be parsed normally in Unity.

Poor use:

LitJson is unstable on IOS, sometimes normal, and sometimes abnormal ..

MiniJson is said to be incomplete and not tested.


The JSON parsing provided in this article works properly on IOS and Android.

Download:

Https://github.com/facebook-csharp-sdk/simple-json

Find the source code and use SimpleJson. cs.

Or the last
Note:

If your target. if the net version is earlier than 3.0 or WP7, you need to add "# define SIMPLE_JSON_NO_LINQ_EXPRESSION" to the file header. Remember to add Unity because Unity is used. net 2.0 (or its subset ).


Usage:

SimpleJson. JsonNode data = SimpleJson. JSON. Parse ("{\" Key \ ": \" value \"}");

// Data ["Key"]. ToString () value: "value"

Note: The value returned by ToString () of JSONNode is double quotation marks. If you need to: float. parse (data ["Key"]. if ToString () is used to convert a string to a number, an error is returned.

Therefore, you can modify the ToString method of JSONNode to remove double quotation marks.


My modified(Modified the above two points ):

Download: http://download.csdn.net/detail/kakashi8841/7086137

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.