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