public virtual void RemoveInventoryItem(Ingredient ingredient, int count)
{
bool foundNothing = true;
GameManager.Get <SoundManager>().Play(useItemEffect);
MessageMenu mm = UIManager.GetMenu <MessageMenu>();
if (count == 1)
{
mm.Open(string.Format("{0} removed", ingredient.displayName), 3, 3f);
CloseMessageMenu();
}
else
{
mm.Open(string.Format("{0} {1}s removed", count, ingredient.displayName), 3, 3f);
CloseMessageMenu();
}
while (count > 0)
{
for (int i = 0; i < ingredientsInInventory.Count; i++)
{
if (ingredientsInInventory[i].id == ingredient.id)
{
ingredientsInInventory.RemoveAt(i);
count--;
foundNothing = false;
break;
}
}
if (foundNothing)
{
Debug.LogError("No item : " + ingredient.displayName + " : id : " + ingredient.id + " was found");
break;
}
}
InitializeInventorySlots();
}