I'm attempting to put a list of 2 element arrays into a scriptable object. I've finally managed to avoid all compiler issues, but I'm not getting anything to populate in the inspector. I'm thinking I should just throw the SO out the window and create an 2D array. here's the entire class:
[SerializeField]
public static List<string[,]> list = new List<string[,]>();
Goal:
- List:
- string, string
- string, string
- and on...
It's been a while since I've played with unity and I'm just trying to make a simple data container. Am I missing something simple?
It's not showing up in the inspector for two reasons:
If you need to have a list of two strings visible in the inspector, I would suggest creating a new object to define what it is you are listing.
For example, if you wanted to list items with a name and a description then you could do something like this:
Notice the
[Serializable]attribute from theSystemnamespace above theItemclass. This allows your custom classes to show up in the inspector as well to be serialized elsewhere.It looks like this in the inspector with a nice little handle to add and remove items:
I hope this clears things up!