- Home /
Best item list
So I am making a game with a lot of items but I am not sure what the best way is to make a list of items. Now I have made my items as children in a vertical layout group and everytime you buy a new item, that item will be set active. I don't think this is the best way to do this but I haven't found a better way. I also tried to put all my items as individual prefabs in a list but that didn't seem to work. Can anyone help?
Answer by sacredgeometry · Dec 06, 2021 at 07:57 PM
Use one of the many collection types supported by C# or one of the subset that are also serialisable. Lists Arrays etc.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/ https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1?view=net-6.0
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
check if list contains item with matching string property 2 Answers
stack by quanity...? C# 2 Answers
How to save a list of items? 3 Answers
Javascript Array to Generic List 1 Answer