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();
}

View file

@ -1,13 +1,14 @@
{
"dependencies": {
"com.cratesmith.assetui": "https://github.com/Cratesmith/Cratesmith.AssetUI.git",
"com.unity.2d.animation": "7.0.5",
"com.unity.2d.pixel-perfect": "5.0.1",
"com.unity.2d.psdimporter": "6.0.3",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.spriteshape": "7.0.4",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.collab-proxy": "1.15.16",
"com.unity.ide.rider": "3.0.13",
"com.unity.collab-proxy": "1.15.18",
"com.unity.ide.rider": "3.0.14",
"com.unity.ide.visualstudio": "2.0.14",
"com.unity.ide.vscode": "1.2.5",
"com.unity.test-framework": "1.1.31",

View file

@ -1,5 +1,12 @@
{
"dependencies": {
"com.cratesmith.assetui": {
"version": "https://github.com/Cratesmith/Cratesmith.AssetUI.git",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "11c14a27283e247f57662038f58d7f41ade9d686"
},
"com.unity.2d.animation": {
"version": "7.0.5",
"depth": 0,
@ -83,7 +90,7 @@
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.15.16",
"version": "1.15.18",
"depth": 0,
"source": "registry",
"dependencies": {
@ -99,7 +106,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.13",
"version": "3.0.14",
"depth": 0,
"source": "registry",
"dependencies": {
@ -130,21 +137,12 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.3.1",
"version": "1.0.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.modules.androidjni": "1.0.0"
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},