Ejemplo n.º 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));
 }
Ejemplo n.º 2
0
 public void FadeOutAmbient()
 {
     if (isPlayingAmbient)
     {
         isPlayingAmbient = false;
         StartCoroutine(AudioFadeScript.FadeOut(musicSource, 1f, false));
     }
 }
Ejemplo n.º 3
0
 public void FadeInAmbient()
 {
     if (!isPlayingAmbient)
     {
         isPlayingAmbient = true;
         StartCoroutine(AudioFadeScript.FadeIn(musicSource, 1f, false));
     }
 }
Ejemplo n.º 4
0
 public void FadeSoundIn()
 {
     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.FadeIn(sound, 1.5f));
     }
 }
Ejemplo n.º 5
0
 public void FlySoundPlay()
 {
     // FlySound.Stop();
     // FlySound.volume = 0;
     AudioFadeScript.Instance.StopAllCoroutines();
     // doonce = true;
     if (!FlySound.isPlaying)
     {
         StartCoroutine(AudioFadeScript.FadeIn(FlySound, 0.01f));
     }
 }
Ejemplo n.º 6
0
 public void FlySOundFadeOut()
 {
     // FlySound.Stop();
     // FlySound.volume = 0;
     AudioFadeScript.Instance.StopAllCoroutines();
     if (FlySound.isPlaying)
     {
         // doonce = false;
         StartCoroutine(AudioFadeScript.FadeOut(FlySound, 0.01f));
     }
 }
Ejemplo n.º 7
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);
    }
Ejemplo n.º 8
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);
    }
Ejemplo n.º 9
0
 public void FadeOutAudioSource(AudioSource audioSource)
 {
     StartCoroutine(AudioFadeScript.FadeOut(audioSource, 1f, true));
 }
Ejemplo n.º 10
0
 public void FadeInAudioSource(AudioSource audioSource)
 {
     StartCoroutine(AudioFadeScript.FadeIn(audioSource, 0.5f, true));
 }
Ejemplo n.º 11
0
 public void FadeIn()
 {
     StartCoroutine(AudioFadeScript.FadeIn(music2, 2.5f));
 }
Ejemplo n.º 12
0
 public void FadeOut()
 {
     StartCoroutine(AudioFadeScript.FadeOut(music2, 0.75f));
 }
Ejemplo n.º 13
0
 public void FadeInBackgroundMusic()
 {
     StartCoroutine(AudioFadeScript.FadeIn(audio, FadeInTime));
 }
Ejemplo n.º 14
0
 public void EnterEncounter()
 {
     SceneManager.LoadScene("BattleScene");
     StartCoroutine(AudioFadeScript.FadeOut(mainTheme, 0.5f));
     StartCoroutine(AudioFadeScript.FadeIn(battleTheme, 5f));
 }