Here is my code. It is suppose to add items to my inventory based on the amount given.
public void AddItem(GameObject item, int amount)
{
for (int i = 0; i < amount; i++)
{
for (int x = 0; x < slots.Count; x++)
{
if (isFull[x] == false)
{
//additem
Instantiate(item, slots[x]);
CheckSlots();
return;
}
else { Debug.Log("Slot Is Full"); }
}
Debug.Log("All Slots Are Full");
}
}
the forloop with i only seems to run once, only adding one item to my inventory regardless of the amount given.