// Update is called once per frame void Update() { enterMenus.volume = PlayerPrefs.GetFloat("SFX") / 100; buySpecificHero(); if (buyToggleActive) { if ((GlobalVariable.GetPlayerGold() < buyCost && buyToggleActive.isOn == false) || (GlobalVariable.GetPlayerGold() - buyCost) < 0) { buyButton.interactable = false; } else if (GlobalVariable.GetPlayerGold() >= buyCost) { buyButton.interactable = true; } } upgradeSpecificHero(); if (upgradeToggleActive) { if ((GlobalVariable.GetPlayerGold() < upgradeCost && upgradeToggleActive.isOn == false) || (GlobalVariable.GetPlayerGold() - upgradeCost) < 0) { upgradeButton.interactable = false; } else if (GlobalVariable.GetPlayerGold() >= upgradeCost) { upgradeButton.interactable = true; } } displaySpecific(CostToBuyHero, buyCost.ToString()); displaySpecific(CostToUpgradeHero, upgradeCost.ToString()); if (backtotownB) { timer -= Time.deltaTime; if (timer <= 0) { SceneManager.LoadScene("Town"); } } }
// Update is called once per frame void Update() { playerGold = GlobalVariable.GetPlayerGold(); GoldText.text = "$" + playerGold; }