Home > Mobile >  Are arrays better than lists in 2d games? [closed]
Are arrays better than lists in 2d games? [closed]

Time:10-01

So I am making an inventory system and I have a choice to make inventory through lists and arrays. Which approach is better and why in C#? This inventory system is for a 2d Platformer in unity.

CodePudding user response:

In .Net, a list is a wrap of an array. It has similar performance, but List has built-in methods to resize the array, which contains all entries of the list. If your arrays are never resized, not need to use List.

  • Related