Woooooooooooooow this was a weird one.
So in Unity you don't just add an array for inventory. No, it can't be that simple. Screw you. How Dare You Assume it! But seriously, it's a little tricky to get this concept. So the inventory must live somewhere. I chose to tag it on the player object (just like I did with sticking the game controls to the HUD object.) This works well for me. I found an inventory system to model after in THIS POST, but found lots of bugs. I tore out a few chunks I could use and scrapped the rest. I won't bother salvaging the GIU, but the basic item class was useful.
Then cam time for adding items. Again, I ran into a slight headache conferencing between scripts. It's something to get used to I guess. Write a script, then write another script, then make a variable by the name of the first script, then in unity, drag the script over, then in the latter script, reference it by another name.
sigh.
Not a big deal, but it feels clunky and foreign. All said, I spent a whole night hammering the keys and, 123 lines of code later, came up with a cool inventory script that updates the HUD, cycles items, and can add them; I also created a loot prefab that can be reused as any item to be picked up.
This may seem like a whiny rant but I can assure all that this is no less than a leap forward toward a completed game. I still need an artist (and lots of artwork) and several game mechanics, but hell, there's almost something to do in this game! Haha!
Until Next time,
Cheers!