Question by
RemDust · Dec 29, 2016 at 05:12 PM ·
listinstancesdatabase handling
duplicate instance instead of referencing it
Hi guys, I've got a database of Items and when Player picks one up, I want to add it in his inventory (which is a scriptable object containing a list of Items).
Now when I do this, I'm ultimately only passing a reference to the item class instead of creating a new instance and put it in the Inventory list. So if I ever change a property of the item, I actually change the property of the whole class in the database...
How can I fix that ? Thanks all !
Comment