Keeping item database

I am making a simple game with relatively large amount of items that serve different functions. The functions are quite different (increasing amount of hp, bullets, enemies, size whatever) therefore I can not rely on a single Item prefab with changeable global variables.

As I have never done this before just wanted to get an insight on ways to do this, before I do it the wrong way. :slight_smile:

My current idea is having a single script (ItemDB) that has another class inside it(Item) with number of variables (for sprite, and values) and a function (onCollect) that can have different code for different objects. Then just write all items out by hand in ItemDB. Is this a good way? Is there a better one?

[EDIT] Also not sure what is supposedly wrong with this question that it would be downvoted :l

Iā€™m keeping my items stored in an XML file that gets converted to a dictionary on game start. Function specific to an item can be stored as strings and called by the SendMessage function.