Why is my List of Lists not showing up in Unity inspector?

Viewed 6579

I would like to create a list of lists in C#, Unity (so I don't have to create 10 seperated lists). It doesn't show any syntax error, however, even though it's public, it doesn't show up in Unity inspector.

public List<List<Sprite>> listOfLists;
1 Answers

Unity inspector aren't to able serialize nested objects, if you want to do that please create and use class structure.

Example code:

[System.Serializable]
    public class serializableClass
    {
        public List<int> sampleList;
    }
    public List<serializableClass> nestedList = new List<serializableClass>();

If you use these type of structure should see this...

enter image description here

Related