See List in Inspector

I have an array using the List class. Is there any way to se the List in the inspector?

Do I need to convert to a builtin Array? If so, how?

I just want to do this as a temp diagnostic - no need for optimizing or proper coding.

Thanks for any help.

Mitch

Assuming you’re referring to the generic List class, instances of that class should indeed show up in the inspector.

Can you post the relevant code?

var v : List.<float>;

Does not show up in the inspector. No errors in the console. Any suggestions? Thanks.

Add “import System.Collections.Generic;” in your script. You can use List in JS without that line, but it won’t show in the inspector, and other things from Generic don’t work either (unless you include the full namespace of course), which is kind of weird. I think they should include the namespace automatically, like with UnityEngine and System.Collections, or else List shouldn’t work at all. Having only List (mostly) work without importing the namespace is kind of confusing.

–Eric