如何从带有锯齿状数组的JSON读取数组

时间:2018-02-21 10:07:00

标签: arrays json

我在Unity3d中使用jsonutility(c#)。下面的代码包含一个锯齿状数组。

如何对锯齿状数组进行反序列化,以获取数组内的值?

{
  "location": [
    [
      {
        "locationId": 2362,
        "locationName": "Shackleford Crossing 554",
        "latitude": 34.731603,
        "longitude": -92.3955491,
        "easternOffset": 0
      },
      {
        "locationId": 2030,
        "locationName": "MISHAWAKA 3301",
        "latitude": 41.6999082,
        "longitude": -86.1882506,
        "easternOffset": 0
      }
    ]
  ],
  "product": [
    [
      {
        "id": 778,
        "name": "Leinenkugel Summer Shandy",
        "style": "Ale"
      },
      {
        "id": 8771,
        "name": "Leinenkugel Harvest Patch Shandy",
        "style": "Ale"
      }
    ]
  ]
}

0 个答案:

没有答案