- Home /
Setting generic list length
Hello, I'm programming in javascript and I made array called "items" and then I made variable Inventory as a List containing items. I can't anywhere find, how to set my Inventory variable maximum length... Say, I want my list "Inventory" can contain only 30 items. I will be grateful for any response.
Answer by Magnomous · Aug 02, 2013 at 10:24 AM
I solved this problem by adding if(y.Count < x) , where y is name of the list and x is the length of the list.
Answer by IgorAherne · Jul 21, 2013 at 08:50 AM
Use a built-in array inventory, wich contains items.
The speed is from Fastest to Slowest:
1) built-in array
2) generic list
3)unity array
built-in array can not be resized and I am looking for a way how to size "Inventory" list...But thanks for response.
Your answer
Follow this Question
Related Questions
Can't add GameObjects to ArrayList 1 Answer
Convert Inventory from JS to C# (problem with list) 2 Answers
Add GameObject to GameObjectArray[] 3 Answers
List array in GUI.Box 0 Answers