Reputation: 43
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;
Upvotes: 4
Views: 15737
Reputation: 177
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...
Upvotes: 6