void updatePanelSlots() { int index = 0; foreach (Transform child in InventoryPanel.transform) { InventorySlotController slot = child.GetComponent <InventorySlotController>(); if (index < itemList.Count) { slot.item = itemList[index]; } else { slot.item = null; } slot.updateInfo(); index++; } }
void updatePanelSlots() { int index = 0; foreach (Transform child in inventoryPanel.transform) { InventorySlotController slot = child.GetComponent <InventorySlotController>(); if (index < list.Count) { slot.item = list[index]; } else { slot.item = null; } slot.updateInfo(); //Update slot[index]'s name and icon... index++; } }