Example #1
0
 public void EndIntro()
 {
     intro = false;
     animatorIntroMusic.FadeOut();
     animatorIntroLogo.gameObject.SetActive(false);
     OpenMenu();
 }
Example #2
0
    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");
            });
        }
    }
Example #3
0
 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();
     });
 }
Example #4
0
    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();
        }
    }
Example #5
0
    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);
    }
Example #6
0
    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();
        });
    }