I'm trying to create an inventory system. There's a few parts to it:
- Item (scriptable Object just the data like name etc of the item)
- ItemDatabase which takes array of Item (scriptable object) and then on awake it looks through and populates a dictionary for ID,data
- ItemStack - Actual item holds an int for an ID so it can get data from the dictionary from it.
My inventory has a list of ItemStacks, but to be able to populate that array the script needs to be on a GameObject, so with how everything works, is it required for me to always have GameObjects in the game basically representing items? I'm new to inventories so is that how its suppose to be? Or am I missing something here? It seems kinda strange if I have 700 different item in my inventory that would require 700 GameObjects created to represent them.
Or maybe I'm overthinking it... but I feel like the inventory should only have "data" and not a GameObject, the GameObject would be for when you spawn an item in the world.