Right now I’m using Scriptable Objects to store Dictionaries that have the object ID as the key, with the value being the prefab of the object. So it looks something like Dictionary<int, Item>. And I have multiple different SO databases for different types of objects, so another one could be something like Dictionary<int, Spell> The problem with this approach is that I have to validate that the dictionary keys correspond to the correct Item whenever I add to the database. (i.e. key == item.id) It just seems clunky to me.
However, because all my item information is stored within a Dictionary, I imagine it will make saving and loading fairly simple. For example, if I want to save the player’s current items, I only need to save a list of ints, each representing the ID of its corresponding item. When I want to deserialize it, I just need to reference the Item dictionary with the IDs.
So I’m curious, what is your approach to storing your static object / item information? Any advice for my current solution?