how to store items in inventory?

I made an inventory trough GUI which consist of a toolbar with 6 windows…
1.)Tms and Hms
2.)items
3.)Medicine
4.)Pokeballs
5.)Berries
6.)keyItems

ok, the problem is that i don’t know how to store items in these …well how can i save information in these because i only need the name of the object to list inside the window… i was thinking of making a class for each of the 6 windows …but i just don’t know how to do it …if any one can point me in the right direction with a script or by suggesting some advice it would be much appreciated.

You should not store information in your GUI. Your GUI should only handle the displaying of, and interaction with, information found in primary objects/managers/controllers (pick your favorite name).

For example, I have an object in 3D space that can be clicked on. It has a single call to my HUD class TargetHUD.Display(this). The HUD knows how to take it from there. They don’t need to know about each other or get tangled in shared code.

So, your inventory should probably just display items found in a list in whatever script you use to manage the state of your player. You may want to make an InventoryItem class with basic information that all inventory items will need, which depends on your game, such as wearable slots, like arms or legs, or number of uses, etc. Then you can use a list on your player.

When the inventory comes up, it simply needs to access this list and based on the information, display everything. When changes are made, it should write the changes to the items, or add/remove items from the list.

This is just one possible design pattern. It is very dependent on your game’s needs.