public void collectStuff(Transform t) { ressource ressource = t.GetComponent <ressource>(); if (ressource != null) { bool ok = inventory.AddToSlots(ressource.item); if (ok) { asteroidBelt.DeleteItem(t); } //Destroy(t.gameObject); } }
public void buy(item i, bool buy) { bool okay = inv.AddMoney(-i.cost); if (!okay) { speechBubble.text = "get some money!"; return; } speechBubble.text = thx[Random.Range(0, thx.Length)]; bool ok = inv.AddToSlots(items.instance.GetIndex(i)); if (!ok) { inv.AddMoney(i.cost); speechBubble.text = "your inventory is full you stupid piece of shit"; } }