public void RemoveItem(Item item) { ItemGui.ItemGuiType type = ItemGui.ItemGuiType.Part; int keyNr = 0; if (item is KeyItem) { /* * TODO: * remove item from the list * update gui */ type = ItemGui.ItemGuiType.Key; keyNr = ((KeyItem)item).keyNr; Debug.Log("as keyitem"); } else { Debug.Log("as normal item"); carryingItem = false; } items.Remove(item); RemoveItemFromGui(type, keyNr); }
public void AddItemToGui(Sprite sprite, ItemGui.ItemGuiType type, int keyNr, Color color) { var newItem = Instantiate(itemGuiPrefab, itemGuiHolder.transform); var itemGui = newItem.GetComponent <ItemGui>(); itemGui.SetItem(sprite, type, keyNr, color); }
public void RemoveItemFromGui(ItemGui.ItemGuiType type, int keyNr) { foreach (var item in itemGuiHolder.GetComponentsInChildren <ItemGui>()) { if (item.RemoveItem(type, keyNr)) { return; } } }
public void RemoveItemFromGui(ItemGui.ItemGuiType type, int keyNr) { MenuManager.Instance.RemoveItemFromGui(type, keyNr); }
public void AddItemToGui(Sprite sprite, ItemGui.ItemGuiType type, int keyNr, Color color) { MenuManager.Instance.AddItemToGui(sprite, type, keyNr, color); }