Unity List of Color array not showing in inspector?
Hi,
in my code, I have a List of Color arrays as so:
public List<Color[]> cols
I wish to be able to assign these in the inspector, however, the list doesn't show up on the script.
Any ideas how I can do this?
Any help is greatly appreciated, thanks!
Answer by TheSorm · Apr 03, 2016 at 02:28 PM
You have to initiate the object and it do not work with a array in a list :
public Color[] cols = new Color[5];
Answer by Masterio · Apr 03, 2016 at 12:39 PM
put it in an array or try to Serialize this property (I am not sure about second solution).
Answer by fugogugo · Apr 03, 2016 at 02:29 PM
the one in your code is not actually "List of Color" instead it's "List of Array of Color"
simply fix it by removing the rectangle bracket like this
public List<Color> cols
Your answer
Follow this Question
Related Questions
How can I have custom inspector variables in an object list? 0 Answers
Question about array 2 Answers
How to prevent an overflow? 1 Answer
I have trouble understanding arrays and enums. When and how? 0 Answers
inspector dynamic dropdown list 1 Answer