Пример #1
0
 public void ExitEncounter()
 {
     // In a full game, your code should remember the player's last area and return there
     SceneManager.LoadScene("Overworld");
     StartCoroutine(AudioFadeScript.FadeOut(battleTheme, 0.5f));
     StartCoroutine(AudioFadeScript.FadeIn(mainTheme, 5f));
 }
Пример #2
0
 public void FadeOutAmbient()
 {
     if (isPlayingAmbient)
     {
         isPlayingAmbient = false;
         StartCoroutine(AudioFadeScript.FadeOut(musicSource, 1f, false));
     }
 }
Пример #3
0
 public void FadeSoundOut()
 {
     AudioSource[] soundsInScene = FindObjectsOfType <AudioSource>();
     //for eaach audiosource in the scene, the source and fade time are passed to the public static method AudioFadeScript
     foreach (AudioSource sound in soundsInScene)
     {
         StartCoroutine(AudioFadeScript.FadeOut(sound, 1.5f));
     }
 }
Пример #4
0
 public void FlySOundFadeOut()
 {
     // FlySound.Stop();
     // FlySound.volume = 0;
     AudioFadeScript.Instance.StopAllCoroutines();
     if (FlySound.isPlaying)
     {
         // doonce = false;
         StartCoroutine(AudioFadeScript.FadeOut(FlySound, 0.01f));
     }
 }
Пример #5
0
    // Fades alpha from 1.0 to 0.0
    IEnumerator FadeToNewScene(string scene)
    {
        AudioSource[] soundsInScene = FindObjectsOfType <AudioSource>();
        //for eaach audiosource in the scene, the source and fade time are passed to the public static method AudioFadeScript
        foreach (AudioSource sound in soundsInScene)
        {
            StartCoroutine(AudioFadeScript.FadeOut(sound, 1.5f));
        }
        yield return(new WaitForSeconds(2.99f));

        SceneManager.LoadScene(scene);
    }
Пример #6
0
    // Fades alpha from 1.0 to 0.0
    IEnumerator FadeToNewScene(string scene)
    {
        if (SoundManager.Instance != null)
        {
            SoundManager.Instance.PlayOneShot(SoundManager.Instance.selectNormal);
        }

        //fade out the sounds in the scene//////////////////
        //assign all the audiosources in the scene to an array
        AudioSource[] soundsInScene = FindObjectsOfType <AudioSource>();
        //for eaach audiosource in the scene, the source and fade time are passed to the public static method AudioFadeScript
        foreach (AudioSource sound in soundsInScene)
        {
            StartCoroutine(AudioFadeScript.FadeOut(sound, 1.5f));
        }

        yield return(new WaitForSeconds(2.99f));

        SceneManager.LoadScene(scene);
    }
Пример #7
0
 public void FadeOutAudioSource(AudioSource audioSource)
 {
     StartCoroutine(AudioFadeScript.FadeOut(audioSource, 1f, true));
 }
Пример #8
0
 public void FadeOut()
 {
     StartCoroutine(AudioFadeScript.FadeOut(music2, 0.75f));
 }
Пример #9
0
 public void FadeOutBackgroundMusic()
 {
     StartCoroutine(AudioFadeScript.FadeOut(audio, FadeOutTime));
 }
Пример #10
0
 public void EnterEncounter()
 {
     SceneManager.LoadScene("BattleScene");
     StartCoroutine(AudioFadeScript.FadeOut(mainTheme, 0.5f));
     StartCoroutine(AudioFadeScript.FadeIn(battleTheme, 5f));
 }