Quantcast
Channel: Questions in topic: "class instance"
Viewing all articles
Browse latest Browse all 131

Adding a prefab to the Item class instance

$
0
0
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 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 ?

Viewing all articles
Browse latest Browse all 131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>