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)); }
public void FadeOutAmbient() { if (isPlayingAmbient) { isPlayingAmbient = false; StartCoroutine(AudioFadeScript.FadeOut(musicSource, 1f, false)); } }
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)); } }
public void FlySOundFadeOut() { // FlySound.Stop(); // FlySound.volume = 0; AudioFadeScript.Instance.StopAllCoroutines(); if (FlySound.isPlaying) { // doonce = false; StartCoroutine(AudioFadeScript.FadeOut(FlySound, 0.01f)); } }
// 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); }
// 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); }
public void FadeOutAudioSource(AudioSource audioSource) { StartCoroutine(AudioFadeScript.FadeOut(audioSource, 1f, true)); }
public void FadeOut() { StartCoroutine(AudioFadeScript.FadeOut(music2, 0.75f)); }
public void FadeOutBackgroundMusic() { StartCoroutine(AudioFadeScript.FadeOut(audio, FadeOutTime)); }
public void EnterEncounter() { SceneManager.LoadScene("BattleScene"); StartCoroutine(AudioFadeScript.FadeOut(mainTheme, 0.5f)); StartCoroutine(AudioFadeScript.FadeIn(battleTheme, 5f)); }