0

I have 2 List in my LocationData class. The first list is: List. The second one is: List>. Whenever I try to convert it to JSON. The first List is being converted successfully, while the List<List<int>> is not.

//Location data class
public class LocationData{
        public List<int> answer_key;
        public List<List<int>> clues;
        public LocationData (List<int> p_answer_key, List<List<int>> p_clues){
            this.answer_key = p_answer_key;
            this.clues = p_clues;
        }
    }

The code below returns JSON: {"answer_key":[5,4,0]} only and not including the second List

//convert to json
string locationDataJSON = JsonUtility.ToJson (locationData);
Debug.Log ("JSON: "+locationDataJSON);

0 Answers0