I am creating nested JSON and binding it with the class. But It doesn't bind with the class.
JSON:
{
"PuzzleData": {
"Category1": {
"Cultus": {
"Type": "Car",
"Name": "Cultus",
"Item1": "gate",
"Item2": "window",
"Item3": "tyre",
"Item4": "tyre"
},
"Lion": {
"Type": "Lion",
"Name": "Animal",
"Item1": "legs",
"Item2": "hands",
"Item3": "head",
"Item4": "eyes"
}
}
}
}
Class:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using System;
[System.Serializable]
public class PuzzleGameData{
public Dictionary<string, Category1> PuzzleData;
[System.Serializable]
public class Category1
{
public string Type;
public string Name;
public string Item1;
public string Item2;
public string Item3;
public string Item4;
}
}
Any help would be appreciated. Thanks.