//restarts the current level void RestartLevel() { Time.timeScale = 1; //LETHAL FORCES if (!restartInProgress) { restartInProgress = true; //sfx GlobalAudioPlayer.PlaySFX("ButtonStart"); //button flicker ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>(); if (bf != null) { bf.StartButtonFlicker(); } //fade out fader.Fade(UIFader.FADE.FadeOut, 0.5f, 0.5f); //reload level Invoke("RestartScene", 1f); } }
//restarts the current level void RestartLevel() { if (!restartInProgress) { restartInProgress = true; GlobalAudioPlayer.PlaySFX("ButtonStart"); //button flicker ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>(); if (bf != null) { bf.StartButtonFlicker(); } Invoke("RestartScene", 1f); } }
/// <summary> /// 重打当前关卡 /// </summary> void RestartLevel() { if (!restartInProgress) { restartInProgress = true; //播放音效 GlobalAudioPlayer.PlaySFX("ButtonStart"); ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>(); if (bf != null) { bf.StartButtonFlicker(); } fader.Fade(UIFader.FADE.FadeOut, 0.5f, 0.5f); Invoke("RestartScene", 1f); } }
//restarts the current level void LoadLevel(string sceneName, int levelId) { if (!restartInProgress) { restartInProgress = true; //sfx GlobalAudioPlayer.PlaySFX("ButtonStart"); //button flicker ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>(); if (bf != null) { bf.StartButtonFlicker(); } //load scene GlobalGameSettings.currentLevelId = levelId; LoadScene(sceneName); } }
public void StartGame() { if (!startGameInProgress) { startGameInProgress = true; //play sfx GlobalAudioPlayer.PlaySFX("ButtonStart"); //flicker button ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>(); if (bf != null) { bf.StartButtonFlicker(); } //fade out FadeOut(); //start Game Invoke("startGame", 1.8f); } }