Question by
SpyChar · Sep 10, 2015 at 11:48 PM ·
inventoryinventory systemitem pickupclass instance
Adding a prefab to the Item class instance
Here is a problem, which is a little bit abstract to me. You may find it foolish, but I am merely a beginner. Let's say I have a Weapon class that derives from Item class. Then, I have a following list of Item class objects
List<Item> itemList;
Next, I create a new Weapon object and add it to the list
itemList.Add(new Weapon(things like: name, description, damage, etc));
The problem is following. How should I add a prefab to it, if I want to be able to drop it from the inventory on the ground? Because if it is on the list, I obviously cannot just drag and drop a gameobject onto it. Or maby am I missing the whole concept :P ?
Comment