How to have an item database and view it on card through out the game?

I am making a game with a lot of items I need a way to store these items and display on demand, there is so many ways I dunno what to choose from, The biggest problem is I need a panel which displays all items and their stats ex: atc, def, etc…, And I need them all to be in 1 scrollable panel, And it is really hard to get the items stats and putting it on a card like UI object on the UI panel, So how can I do that?

I mean I can do it manually but there is human error probability and this is time wasting as I have a lot of items

I can have each card like UI object to have script which where I put an item in it and it spreads it to the picture UI, name UI, Description UI etc…, but again I need to put all my items in 1 scrollable grid and this grid must be in all scences so that the user can just click on menu then weapons menu, armor menu, accessory menu, So does that mean I will have over 150 items in each panel throwout the game in every scene?, Doesn’t that cost alot performance wise?

personally I’d use scriptableobjects to hold the card data and have a generic panel with a script that reads the given scriptableobject and adds the appropriate contents.

1 Like

start here:

https://docs.unity3d.com/Manual/HOWTO-UICreateFromScripting.html

1 Like

There are some good tutorials on how to making a scrolling “thing” in the unity tutorials. My suggestion is have a big List of your items. Have you Panel show the current item, and 1-2 items before the current item in the list and 1-2 after the current item in the list. Then if the user scrolls to the next item the UI can handle that… and while thats going on… update the 2 items before and after the currently shown item to be correct. Basically you only keep in memory 5 graphical representation of items at at time even if you have a database of 1000 items.

1 Like