public void UpgradeFuel() { int currentGems = PlayerPrefsController.GetMaxGems(); if (currentGems >= fuelCost && fuelLevel < maxFuelLevel) { fuelLevel++; PlayerPrefsController.SetMaxFuel(PlayerPrefsController.GetMaxFuel() + 500); PlayerPrefsController.SetMaxGems(currentGems - fuelCost); PlayerPrefsController.SetFuelLevel(fuelLevel); AudioSource.PlayClipAtPoint(audioToPlay[0], Camera.main.transform.position); GameObject fireworkVFX = Instantiate <GameObject>(fireworks, spawnLocation.transform.position, Quaternion.identity); Destroy(fireworkVFX, fireworkDelayToDestroy); } else { AudioSource.PlayClipAtPoint(audioToPlay[1], Camera.main.transform.position); } }
void Awake() { maxFuel = PlayerPrefsController.GetMaxFuel(); fuelLevel = PlayerPrefsController.GetMaxFuel(); lives = PlayerPrefsController.GetMaxLives(); }