//SELLING public void sellPlant() { if (pm.getCount() == 1) { return; } int value = price; if (maturity == MATURITY.SAPLING) { value = (int)(price * .75f); } else if (maturity == MATURITY.JUVENILE) { value = price * 2; } else { value = (int)(price * 3.5); } ItemManager.money += value; sell.gameObject.SetActive(false); Menu.running = true; pm.sellPlant(pm.getAll()[0], gameObject); }
public void buyPlant() { if (ItemManager.money < price || pm.getCount() == pm.getMax()) { return; } ItemManager.money -= price; pm.addPlant(store.getPlant(), entity); }