Questions tagged [litjson]

LitJSON is a small and fast library for handling data in the JSON format. It is written in C# and is compatible with all .Net languages.

LitJSON is a small and fast library for handling data in the JSON format. It is written in C# and is compatible with all .Net languages.

37 questions
0
votes
0 answers

Use LitJson and Json file served from a URL in place of local Json file

Needing help with a json (LitJson) issue. I am trying to read a json file from the web in the same way as I am able to read a local json file. the way I read the local file is like this public JsonData itemData; itemData =…
cyo
  • 69
  • 1
  • 14
0
votes
1 answer

Convert LitJson to Newtonsoft Json for run at IOS device Unity C#

How to convert the LitJson Json To NewtonSoft Json in unity c# ? Example : In LitJson JsonData CJsonData; cJsonData = JsonMapper.ToObject(www.downloadHandler.text); Debug.log(cJsonData["reason"].ToString(); // This cJsonData can contain a nested…
Dennis Liu
  • 2,268
  • 3
  • 21
  • 43
0
votes
2 answers

c# With Unity and LitJSON Getting an Invalid Cast Exception when trying to de-serialize back from JSONData object

I have been working on a save game solution for my project and have hit a wall. After several days of research, trial/ error etc. I decided to give the stack a shot. I am attempting to convert back from a Json text file into an object, then add it…
Dave cook
  • 1
  • 1
0
votes
2 answers

Extra garbage produced by LitJson serialization with AWS SDK for MonoAndroid10

When I run the following code in a windows console application referencing AWSSDK.Core.3.3.19.1\lib\net45\AWSSDK.Core.dll, I get nice output: public class Person { public string Name { get; set; } public int Age { get; set; } public…
BlueMonkMN
  • 25,079
  • 9
  • 80
  • 146
0
votes
1 answer

How to get the key name in json?

My previous problem was I'm unable to arrange the json structure like what I wanted. And I found some answers that looks like it almost satisfy my needs but unfortunately I don't know if it's working or not because another problem has…
Ali Akbar
  • 39
  • 10
0
votes
2 answers

Is it possible to have nested array json?

I'm kinda new with json. So I want to make an array value inside a value of an array like below. { "id": 0, "title": "LEVEL", "value": [10[2,3,5], 1] } But unfortunately It's not working. It gives me an error when I tried to read the…
Ali Akbar
  • 39
  • 10
0
votes
1 answer

How to take a particular field from json data in unity

Using google reverse geocoding i get a json. i need to access a particular field from it. i tried the following code private void Processjson(string jsonString) { JsonData jsonvale = JsonMapper.ToObject(jsonString); Debug.Log…
Martin j
  • 511
  • 1
  • 9
  • 31
0
votes
1 answer

Why wont LitJSON work in build, but does work in the editor?

I am working in Unity, and I am trying to use LitJSON for an inventory and ability system, as well as stats. I made that work, and it all works via some functions I put in a script. In unity, it works really well. However, when I build the game for…
0
votes
2 answers

How do I use LitJson to edit single attributes of multiple instances of one class all stored in one json file?

I am trying to create an inventory system using a json file. Basically, I have my json file: [ { "name":"Potion", "id":1, "balance":5 }, { "name":"Neutral Bomb", "id":2, "balance": 4 } ] And I have my c#…
Miles Kim
  • 47
  • 9
0
votes
1 answer

Read Json to build meshes in Unity

I am trying to use LitJson to read data from a Json file and build meshes in Unity. Part of the Json data are polygons which take the form of 2-D arraies(like:u'polygon0': [[2, 18.2], [6, 18], [4, 20]],u'polygon1': [[10, 18], [15, 18], [12,…
Bowen Kuang
  • 100
  • 7
0
votes
0 answers

JSON Array to C# Array with LitJson

I am trying to convert an array in JSON to a sort of array (Maybe a list?) in C# for a Unity game. I have tried everything I can think of to do this, but with no success. Here is an example of the JSON that I am trying to convert, without an array: …
ZachHofmeister
  • 163
  • 1
  • 2
  • 6
0
votes
1 answer

Parsing JSON string into objects, then into list using LitJson

I'm trying to parse this string: [{"busses":[{"bus":1,"time":"2016-10-11 04:56:01","lat":"30.5198498","lon":"-90.47052981","acc":"6.0\n"},{"bus":2,"time":"2016-10-11…
0
votes
0 answers

Unity Refresh JSON chat feature C#

I'm currently developing a chat feature, it GETs message and message info from a JSON file on a server and displays them in a UI text. When the app starts it displays the messages perfectly, however when a new message is POSTed to the server I can't…
0
votes
1 answer

LitJSON: Unable to use foreach in Unity

I'm using LitJSON to load .json data, and I'm running some test code with a foreach loop, but it's not working. InvalidOperationException: Instance of JsonData is not a dictionary LitJson.JsonData.EnsureDictionary() (this error is thrown when the…
Novark
  • 419
  • 4
  • 15
0
votes
1 answer

How to Add Data from a litJson save File to List

What I'm trying to do is add the data I have saved in a litjson file to a list, and in the correct format. So I can call it in the game later on, as icons. Here's the code, so it should be easy to recreate to test the problem I'm having. JsonIcons…
War Mind
  • 1
  • 1