I’m having a little issue with my inventory system which consists of 35 different slots.
Each slot is a button and when that button is clicked I want my code to set the currently selected slot in my Inventory code to be the InventorySlot component of that button.
However, using the new UI system it would be very painful going through every single button in the inspector and assign all of them to a function.
So I’m wondering if there is any way to for example do this :
ListOfInventoryButtonSlots = CreateAllButtons() for every button in ListOfInventoryButtons, check if it is pressed; if it is, get the InventorySlot component of that button and set the selected slot to be that component.
Hope this makes sens,e if not please comment and I’ll try to explain again.