I have a Database script that holds a list of many items that i created through custom classes. Item is the base class and equipment inherits from item class. I fill my players inventory from pulling from this database of items. All was well until i added a way for the player to upgrade the level and stats of an item. It is leveling up the item in the database. I then found out that all the items that my players have obtained are just references to the item class in my database. I would like to have copies of these items that can be upgraded individually.
This is how i am pulling from the list…
[SerializeField] private List<Item> items = new List<Item>();
public Item GetItem(int id)
{
return items[id];
}
How can i get a (copy) of the item from my list and not the actual item in the list?
Instantiate will not work because it is not a GameObject.
Should it be done in a constructor?
Working with instance ids?
Man i am stumped here, Please help!!!
Thanks in advance!
-Bryan