Hello! I'm making game, and there will be some inventories in rpg style (bags with items?.
I'm thinking about way how to create them. I think about 2 ways:
- precreate inventories with all items in them (like 3 bags with 20 items in each bag) and make them invisible before player opens them.
- create all menus with slots and items when player opens bag and destroy it when he closes bag.
Both way have their downsides: invisible objects will be kept in memory, while creating and destroying objects every time when bag is opened or closed doesn't look good too.
Maybe you can give me some advices, which way is better?