public void Upgrades() { // only if player has lives to spare if (lives > 1) { // temporarily block keyboard inputs and pause allowInputs = false; upgrading = true; Pause(); upgrades.SetActive(true); heartsGUI.Display(); // randomly select available upgrades button1.GetComponent <UpgradeButton>().LoadPowerUps(); button2.GetComponent <UpgradeButton>().LoadPowerUps(); } }