display no number in inventory when only 1 item is in the slot
This commit is contained in:
parent
ce1f6ed389
commit
d28a1947eb
3 changed files with 17 additions and 16 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue