public void EndIntro() { intro = false; animatorIntroMusic.FadeOut(); animatorIntroLogo.gameObject.SetActive(false); OpenMenu(); }
public void FixedUpdate() { // Intro if (intro && Input.anyKeyDown) { EndIntro(); } // "Press any key to continue" -> Start Game if (pressAnyKeyToContinue && Input.anyKeyDown) { pressAnyKeyToContinue = false; audioSourceEffects.PlayOneShot(clickSound); animatorPressAnyKeyToContinue.FadeOut(); animatorMusic.FadeOut(); animatorGuide.FadeOut(() => { GameObject.FindWithTag("Player").GetComponent <CameraScript>().StartGame(); SceneManager.UnloadSceneAsync("MainMenu"); }); } }
public void Quit() { if (startPressed || quitPressed) { return; } quitPressed = true; animatorMusic.fadeOutSpeedMultiplier = 3; animatorMusic.FadeOut(); audioSourceEffects.PlayOneShot(screenOffSound); animatorScreenEffect.FadeOut(async() => { await Task.Delay(TimeSpan.FromSeconds(0.5f)); Application.Quit(); }); }
public async void StartIntro() { intro = true; await Task.Delay(TimeSpan.FromSeconds(2f)); animatorIntroLogo.FadeIn(); await Task.Delay(TimeSpan.FromSeconds(3.5f)); animatorIntroLogo.FadeOut(); await Task.Delay(TimeSpan.FromSeconds(1f)); if (intro) { EndIntro(); } }
public async void StartGame() { audioListener.enabled = true; await Task.Delay(System.TimeSpan.FromSeconds(1f)); //audioSourceEffects.PlayOneShot(soundStartGame); audioSourceBackgroundMusic.clip = musicBackground; audioSourceBackgroundMusic.loop = true; audioSourceBackgroundMusic.Play(); hudCameraAnimator.FadeOut(); ruleRotating.Allow(RULE_REASON_LOADING); ruleMovement.Allow(RULE_REASON_LOADING); await Task.Delay(System.TimeSpan.FromSeconds(1.4f)); ruleShooting.Allow(RULE_REASON_LOADING); ruleReloading.Allow(RULE_REASON_LOADING); }
public void StartGame() { if (startPressed || quitPressed) { return; } startPressed = true; audioSourceEffects.PlayOneShot(clickSound); animatorMenuItems.FadeOut(); animatorPlanet.FadeOut(async() => { animatorLoading.FadeIn(); await Task.Delay(TimeSpan.FromSeconds(1f)); animatorGuide.FadeIn(); await Task.Delay(TimeSpan.FromSeconds(1.1f)); SceneManager.LoadSceneAsync("NoiseWorld", LoadSceneMode.Additive); await Task.Delay(TimeSpan.FromSeconds(1f)); pressAnyKeyToContinue = true; animatorLoading.FadeOut(); animatorPressAnyKeyToContinue.FadeIn(); }); }