void ButtonActivation() { GameObject turretButton = GameObject.Find("Button Turret"); GameObject wallButton = GameObject.Find("Button Wall"); GameObject upgradeButton = GameObject.Find("Button Upgrade"); GameObject cancelButton = GameObject.Find("Button Cancel"); if (active.building == null) { turretButton.GetComponent <Button>().interactable = player.Money >= turret.GetComponent <Turret>().costs; wallButton.GetComponent <Button>().interactable = player.Money >= wall.GetComponent <Wall>().costs; upgradeButton.GetComponent <Button>().interactable = false; } else { turretButton.GetComponent <Button>().interactable = false; wallButton.GetComponent <Button>().interactable = false; upgradeButton.GetComponent <Button>().interactable = player.Money >= active.upgradeCosts(); } }