The question is answered, right answer was accepted
c# Need help with a simple inventory, 3 slot hotbar.
i need help making the hotbar in my game it has 3 slots and cannot stack items, it's an 3D game, when i pick up the item i destroy it and want to display an sprite for the 3d object. simple to add new items and a simple dropping system. can anyone help me?
Answer by RobAnthem · Feb 14, 2017 at 12:11 AM
Create an item class with data like Icon, Name, etc, and a hotbar class, tie items to the hotbar via your pickup event, and swap the sprite on your hotbar slot to its associated item. Then make your hotbar buttons have an onclick event associated with the item. I'm on my phone, so no code examples, but if you need some I can write an example later.
this might be three years late but I'm stuck on the same problem... If you can can you show me a example and where I would put the scritps?