void Insert(anItem It) { if (It.item != null) { for (int i = 0; i < It.Amount; ++i) { Items.Insert(z, It.item); ++z; } } }
void Sorting(anItem AI, Item It) { if (!Placed) { if (AI.item == null || (It == AI.item && AI.Amount < It.StackSize)) { Placed = true; AI.item = It; ++AI.Amount; } } }
void Disp(anItem It) { if (It.item != null) { Slots[i].GetComponentInChildren <Image>().color = Color.white; Slots[i].GetComponentInChildren <Image>().sprite = It.item.sprite; if (It.Amount > 1) { Slots[i].GetComponentInChildren <Text>().text = "" + It.Amount; } else { Slots[i].GetComponentInChildren <Text>().text = ""; } } else { Slots[i].GetComponentInChildren <Image>().color = Color.clear; Slots[i].GetComponentInChildren <Text>().text = ""; } ++i; }
void Compare(anItem I) { if (I.item != null) { if (I.item.Type == "Sword") { ++SwordIm; if (SwordIm == WantedSword) { Sword.GetComponentInChildren <Image>().sprite = I.item.sprite; Sword.GetComponentInChildren <Text>().text = "" + I.Amount; SwoText.text = I.item.name; } } if (I.item.Type == "Shield") { ++ShieldIm; if (ShieldIm == WantedShield) { Shield.GetComponentInChildren <Image>().sprite = I.item.sprite; Shield.GetComponentInChildren <Text>().text = "" + I.Amount; ShiText.text = I.item.name; } } if (I.item.Type == "Special") { ++SpecialIm; if (SpecialIm == WantedSpecial) { Special.GetComponentInChildren <Image>().sprite = I.item.sprite; Special.GetComponentInChildren <Text>().text = "" + I.Amount; SpeText.text = I.item.name; } } } }