Let me explain a little about the pickup items and inventory to make this much clearer.
Every in world item that can be picked up has a
ScriptableObject assigned to it that contains all the information about that item (
When a player picks up an item it gets added to a
InventoryItem is a class that gets populated with some of the data pulled from the
maxstacksize), and also gets an
I want to save the players inventory, but want to simplify the
InventoryItem data. So I created an
InventoryItemSimple struct that holds the
amount for each item in the inventory, and then save that list to file.
When loading the player inventory, currently I have a BIG list of
ScriptableObjects that map to the
id. So I am looping over the saved inventory list and matching against the
id in the lookup table, and then adding the item to the inventory. I want to avoid this as over time their could be 2,000+ unique objects that could be in the world.
What's a better method to handle this?
If I stick with the lookup table, do I need to worry about how much memory is being used? I don't think my lookup table will ever contain 2,000+ elements. But the thought of having one massive list to manage doesn't appeal to me.