public void UpdateUIAfterAdd() { inventoryUI.Add(powerUps[powerUps.Count - 1], (powerUps.Count).ToString()); if (current >= 0) { inventoryUI.Highlight(current); } }
public void Add(InteractiveObject io) { if (IsFull()) { return; } all.Add(io); ui.Add(io); }
/* ------ Inventory ------ */ public void AddItem(string item) { inventory.Add(item); if (item != "Pizza" && item != "Heart") { invUI.Add(item); } if (item == "Key") { levelManager.FoundKey(); } else { if (item == "Graters") { playerManager.melee_dmg = 2; } else if (item == "Carrot") { levelManager.AdjustLights(); } Sprite itemSprite = shown_info[item]; // if returns null, then have shown before. If does NOT return null, then must show if (itemSprite == null) { return; } else { itemInfo.DisplayItem(itemSprite); shown_info[item] = null; paused = true; showing_item = true; PauseGame(); } } }