public void SetItem(ItemInstance itemInstance) { this.slot.SetItem(itemInstance); }
// Insert an item, return the index where it was inserted. -1 if error. public int InsertItem(int tabIndex, ItemInstance item) { return(inventoryTabs[tabIndex].InsertItem(item)); }
public GameObject prefabInstance; // frontend public void SetItem(ItemInstance itemInstance) { this.itemInstance = itemInstance; prefabInstance = Instantiate(itemInstance.item.itemObject, transform); }
// Get an item if it exists. public bool GetItem(int tabIndex, int index, out ItemInstance item) { // inventory[index] doesn't return null, so check item instead. return(inventoryTabs[tabIndex].GetItem(index, out item)); }