Search Unity

How do you guys Inventory?

Discussion in 'Scripting' started by joemost29, Aug 31, 2015.

  1. joemost29

    joemost29

    Joined:
    Jul 2, 2014
    Posts:
    11
    Don't worry.. I understand how the database works.. but my one lingering question was:

    I am guessing for each item I would create a prefab object, like a sword or arrow.. I was thinking about giving each prefab a script to reference a list of all the items I have created,

    each item I create programatically has a ID, I was trying to figure out how I could get each prefab to follow its attributes as well...


    any help would be awesome
     
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    If you are using C#, then create an item class. Then you could define, what type(Cloth,Food,Weapon) is the GameObject. From there you need to only set the attack strength, and some bonus features, for special weapons.