- Home /
Question by
Alex-Slavski · Nov 20, 2018 at 11:46 PM ·
mobileinventoryscriptable object
Getting random item in Inventory built on Scriptable objects
I want to build a simple inventory based on Scriptable Objects (SO) with qualities also made with SO (rarity, quality, category and so on). It will contain thousands of items and target platform is mobile so I would like to be as efficient as possible.
So the question is: how do I go about getting a random item with given qualities (rarity and category)?
If there is a cleaner way of doing it instead of Scriptable objects please let me know.
Comment
Best Answer
Answer by Alex-Slavski · Nov 23, 2018 at 09:07 AM
It turned out that LINQ does precisely what I need, but there still has to be a List<> with all of them included.