private IEnumerator BuildConsumableList() { float upperBound = fullness.GetMaxAttributeValue() * (maxFullness - hungerValue) / 100; int invSize = inventory.GetSize(); consumableIndex.Clear(); for (int i = 0; i < invSize; i++) { ConsumableItem food = inventory.GetItemInSlot(i) as ConsumableItem; if (food == null) { continue; } if (food.GetSize() <= upperBound) { consumableIndex.Add(i); } yield return(null); } }