Hello, I have a JSON file that looks something like this (pic 1). I want to pull all that data into unity, so I've created a class that represents the way the data is serialised
public class Department
{
public int id;
public string name;
public string goal;
public int semesters;
public string[] towns;
}
normally, if I just had an array of department objects I'd do something like
[System.Serializable]
public class DepartmentList
{
public Department[] test_1;
}
public DepartmentList myDepartmentList = new DepartmentList();
void Start()
{
myDepartmentList = JsonUtility.FromJson<DepartmentList>(textJSON.text);
}
However given that my department objects are actually deep inside a maze of arrays, how would I go about getting that data?
I've already tried declaring a multidimensional array in the DepartmentList class like
//kept adding and removing commas in case it worked, it didn't
public class DepartmentList
{
public Department[,,,] test_1;
}
but that didn't work, so I'm open to ideas