public void KupItem() { GameObject.Find("btnClick").GetComponent <AudioSource>().Play(); //jedlo nepôjde do inventára - rovno sa konzumuje if (item.isFood) { if ((float)item.cost <= character.brubles) { character.DecreaseMoney(item.cost); GameObject.Find("errors_text").GetComponent <Text>().text = "YOU BOUGHT " + item.name + " FOR " + item.cost; character.RestoreHealth(item.restoreHealth); character.AddCancer(item.plusCancer); character.AddDrunk(item.plusDrunk); if (character.currentHealth >= character.maxHealth) { character.RestoreHealth(0); } } } else if ((item.cost <= character.brubles) && (item.isBought == false) && ((Inventory.instance.space - 4) > Inventory.instance.items.Count)) { character.DecreaseMoney(item.cost); GameObject.Find("errors_text").GetComponent <Text>().text = "YOU BOUGHT " + item.name + " FOR " + item.cost; Inventory.instance.Add(item); item.isBought = true; } else if (item.isBought == true) { GameObject.Find("errors_text").GetComponent <Text>().text = "YOU ALREADY OWN THIS ITEM!"; } else if ((Inventory.instance.space - 4) <= Inventory.instance.items.Count) { GameObject.Find("errors_text").GetComponent <Text>().text = "NOT ENOUGH SPACE!"; } }