//Update the player Upgrade Score. 20 points is the max. Modulus used to divide tiers into x/10 slices. void Update() { if (PlayerStatsManager.GetUpgradePoints() == 20f) { upgradeCounter.text = "Next Upgrade: MAX"; } else { upgradeCounter.text = "Next Upgrade: " + PlayerStatsManager.GetUpgradePoints() % 10 + "/10"; } }
// Update is called once per frame void Update() { if ((Input.GetKey(KeyCode.Space) && Time.time > fireCoolDown) || (Input.GetKeyDown(KeyCode.Space))) { if (PlayerStatsManager.GetUpgradePoints() < 10) { Shoot(0); } if (PlayerStatsManager.GetUpgradePoints() >= 10) { Shoot(1); } if (PlayerStatsManager.GetUpgradePoints() >= 20) { Shoot(2); } fireCoolDown = Time.time + fireRate; } }