display no number in inventory when only 1 item is in the slot

This commit is contained in:
dhain 2022-06-02 12:13:58 +02:00
parent ce1f6ed389
commit d28a1947eb
3 changed files with 17 additions and 16 deletions

View file

@ -45,7 +45,9 @@ public class InventoryUI : MonoBehaviour {
for(int i = 0; i < _slots.Length; i++) {
if(i < _inventory.items.Count) {
_slots[i].AddItem(_inventory.items.ElementAt(i).Key);
_slots[i].amountText.text = "" + _inventory.items[_inventory.items.ElementAt(i).Key];
if(_inventory.items[_inventory.items.ElementAt(i).Key] > 1) {
_slots[i].amountText.text = "" + _inventory.items[_inventory.items.ElementAt(i).Key];
}
} else {
_slots[i].ClearSlot();
}