public void LoadInventoryPanel(Inventory inventory, SlotPanel panel, SlotPanelData panelData) { if (panelData == null) { return; } panel.EmptyAllSlots(); inventory.ClearItems(); for (int i = 0; i < panelData.SavedSlots.Length; i++) { BaseItemSlot itemSlot = panel.ItemSlots[i]; BaseItemSlotData savedSlot = panelData.SavedSlots[i]; if (savedSlot.itemID == 0) { itemSlot.ItemInSlot = null; } else { itemSlot.ItemInSlot = GameManager.Instance.ItemDatabase.GetItem(savedSlot.itemID); itemSlot.UpdateSlot(itemSlot.ItemInSlot); inventory.Items.Add(itemSlot.ItemInSlot); } } }
private void UpdateCraftingResultSlot(Item itemToCraft) { craftResultSlot.UpdateSlot(itemToCraft); }