void Finish(bool complete) { if (complete == true) { completeMenu.Show(); enemyNumbersLabel.text = "0"; targetReticle.SetActive(false); // Unlock the next level GameSettings settings = Singleton.Get <GameSettings>(); if ((Application.loadedLevel >= settings.NumLevelsUnlocked) && (Application.loadedLevel < settings.CreditsLevel.Ordinal)) { settings.NumLevelsUnlocked = Mathf.Clamp((Application.loadedLevel + 1), 1, settings.NumLevels); } // Play sound successSound.Play(); } else { deadMenu.Show(); // Play sound failSound.Play(); } pauseStartedRealTime = -1f; jetSound.Stop(); enabled = false; Time.timeScale = 0.1f; }
public void OnCoinCollectionChanged(CoinCollection collection) { if (collection.NumCoins > 0) { StartCoroutine(PopUp(collection.NumCoins, collection.MaxCoins)); } else { levelCompleteMenu.Show(); } }