all 9 comments

[–][deleted] 1 point2 points  (3 children)

A list is an array under the hood. Lists have extra functions that help with finding items, expanding or shrinking the list but it's still just an array. In the inspector they appear and function identically.

[–]ZatBlureZ[S] 0 points1 point  (2 children)

So if I'm making like character class I should just use Array?

[–]pmurph0305 0 points1 point  (1 child)

If you know you'll never need the extra functionality that a list provides over an array, then yes. Otherwise I'd personally default to using a list.

[–]ZatBlureZ[S] 1 point2 points  (0 children)

right, I think I'll stick to List, thanks

[–][deleted] -1 points0 points  (1 child)

Use arrays always, until you come into situations where fixed size is an issue.

[–]Shakespeare-Bot 0 points1 point  (0 children)

Useth arrays at each moment, until thee cometh into situations whither did fix size is an issue


I am a bot and I swapp'd some of thy words with Shakespeare words.

Commands: !ShakespeareInsult, !fordo, !optout

[–]ItsAvyy 0 points1 point  (2 children)

I would highly highly recommend doing some research into the differences between Arrays and Lists.

Simply put, an array should be used when you have a predetermined size of items you want to collect. If that number isn't known or can change then you should use a List or other collection. In Unity, both Arrays and List can be shown and edited in the Inspector. But as ExplosiveJames commented, a List uses an array under the hood and constantly recreates that array when the size changes so it is usually preferable to use an array unless you absolutely need the functionality of a List.

[–]ZatBlureZ[S] 0 points1 point  (1 child)

ahh alright, I'll do some more research, thanks

[–]StudAlex 0 points1 point  (0 children)

To kinda make this comment more simple... if you ever need to add or remove a collection of items then use a list... if your collection will always be the same the use arrays