I'm currently trying to make an inventory system and not sure what the best way is to display an items info
I recently had everything working then lost a week of progress, so now I'm back to figuring out how to display items into a slot
My last method was instantiating the slots prefab and placing them into an array, then also instantiating a child into the slot prefab that contained the image component and placing this into an array as well
My item method included an array for the inventory an array for deleting object(setting to null) then the item that got placed into the slot as a child while also being added to an array. The arrays allowed me to get what I wanted from each object and it worked perfectly or at least for me as it was a rushed attempt. I'm now looking into a less rushed approach.
Should the slot contain all the text components and image or should the item be the one that displays and holds that stuff?
Since it seems getchildcomponent and getchild(index) is the best solution how would I get inside an array of slots and find its children and the children's children. Or is this only ment for actually knowing it's name and it not being slot[I] image[I] I for 0-infinite
Thank you for any assistance, I'm new to unity and coding.