Do I need to rework whole item system?

Hello, I’d like hear from you some ideas. This is the problem:

I’ve made base class Item. It has some fields (e.g. name, itemModel, icon, etc), methods and virtual method CopyYourself() which returns instance of itself.

Then there are other classes like Weapon, Armor, Shield, … Weapon has fields like damageValue and Armor has armorValue. All of these classes override CopyYourself() and return themselves.

Then I’ve made script ItemDatabase which inherits from MonoBehaviour. It is attached to GameController GameObject. This script includes few generic lists. E.g.:

public static List<Weapon> weapons;

In Awake() method I’ve added some weapons into this list. E.g.:

weapons.Add(new Weapon(6, WeaponType.One_Handed, "Basic Sword", LoadObject(_WEAPONS_PATH, "Basic Sword"), LoadIcon("Basic Sword"), 3, 2, 1));

(variables in the constructor are not part of the problem, so I won’t explain them).
But the part LoadObject(_WEAPONS_PATH, “Basic Sword”) important is. LoadObject is function located in ItemDatabase script. It returns GameObject found in “Resources” folder.

I’ve even made inventory and all of it nicely worked. I can add items there, equip them etc. Inventory is fully functional.

I’ve made some enemies and all of them have method Death(). Once they die, they drop items. Works perfectly…

They drop items so, that they check their list of items that can drop from them. In this list are items from ItemDatabase. It uses CopyYourself() function to make a copy of this item from database (and sometimes makes some changes of this instance) and then instantiates its itemModel. Also, works perfectly.

But here is the problem:
When player wants to pick them up from the ground, this itemModel has no idea that it is weapon, armor or even that it is actually Item. Yes, I can tag all of these models as e.g. Item, but the thing is that even if I do that, it will not know what damage this item has, what icon this item has, etc.

And now I am desperate what to do… I would not like to delete all of this… But maybe it is necessary? Maybe I MUST do it so, that every itemModel has attached it’s own script to it that defines its damage, icon, etc. ?
Or how could I make it so, that after dropping this item it knows that it is weapon with damage x, with icon y?

I appreciate really ANY help and I thank to all of you in advance.

Create a new MonoBehavior script called “ItemHolder”. This script will have one variable only: An instance of the Item class. All item model prefabs will have this script on them, with the Item variable of the ItemHlder holding the corresponding Item values. When you pick up an item, you access this component and copy the Item values from the ItemHolder script to the inventory slots or whatever, and destroy the gameobject. When you drop an item, you do it the other way around: You instantiate the prefab, access it’s ItemHolder component, and copy the Item values from the inventory to the ItemHolder (only neccessary if the values can change while inside the inventory, as the prefab will already hold the default Item values).