- Home /
Displaying objects in lists of lists.
I have the following intialized object:
public List<List<MediaInfo>> _mediaLists = new List<List<MediaInfo>>();
but it doesn't show up in the inspector. MediaInfo is [System.Serializable]. Any reason why this might happen? Is it not supposed to work? Thanks for your time.
Comment
Best Answer
Answer by PAEvenson · Dec 18, 2012 at 01:57 PM
I found a work around by creating another class with the list of your objects like so:
public List<MediaList> _mediaLists = new List<MediaList>();
[System.Serializable]
class MediaList
{
public List<MediaInfo> infos;
}
[System.Serializable]
class MediaInfo
{
//your info data
}
Answer by Adamcbrz · Dec 18, 2012 at 01:44 PM
I don't believe unity has a built in mechanic to display lists of lists. You can use an Editor script to create a custom inspector and do it yourself.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Custom Display for system.object Editor 1 Answer
Editing a List<> in Inspector 4 Answers
Error when trying to Serialize a field that is in a class 0 Answers