private static IEnumerator FadeOutExit() { FadeMusic.FadeOutMusic(); SceneChanger.FadeToScene(); yield return(new WaitForSeconds(1)); Application.Quit(); }
protected override void Initialize() { base.Initialize(); footDust.Stop(); jumpDust.Stop(); stateMachine.Initialize(idleState); fadeMusic = GameObject.Find("MusicPlayer").GetComponent <FadeMusic>(); }
private static IEnumerator FadeOutMainMenu() { FadeMusic.FadeOutMusic(); SceneChanger.FadeToScene(); yield return(new WaitForSeconds(1)); SceneManager.LoadScene("MainMenuBox"); }
private static IEnumerator NextScene() { FadeMusic.FadeOutMusic(); SceneChanger.FadeToScene(); yield return(new WaitForSeconds(1)); SceneChanger.NextScene(); }
// Start is called before the first frame update void Start() { S = this; musicFader = this.GetComponentInChildren <FadeMusic>(); fadeInMusic = true; soundMgr = this.GetComponent <AudioSource>(); startGame(); }
void Start() { m_SoundFader = GetComponent <FadeMusic>(); //Make sure the pointer is disabled EnablePointer(false); //Make sure player can move Time.timeScale = 1; }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(instance); }
// Use this for initialization void Start() { // Find object with has the script ScrollGameOverText GameObject textScroll = GameObject.FindGameObjectWithTag("Finish"); // Get a reference to script ScrollGameOverText sTxt = textScroll.GetComponent <ScrollGameOverText>(); // Find camera with script on it GameObject camera = GameObject.FindGameObjectWithTag("MainCamera"); // Get reference to script FadeMusic fm = camera.GetComponent <FadeMusic>(); // Get reference to script GameControl gc = camera.GetComponent <GameControl>(); }// End Start()
// Use this for initialization void Start () { // Find object with has the script ScrollGameOverText GameObject textScroll = GameObject.FindGameObjectWithTag("Finish"); // Get a reference to script ScrollGameOverText sTxt = textScroll.GetComponent<ScrollGameOverText>(); // Find camera with script on it GameObject camera = GameObject.FindGameObjectWithTag("MainCamera"); // Get reference to script FadeMusic fm = camera.GetComponent<FadeMusic>(); // Get reference to script GameControl gc = camera.GetComponent<GameControl>(); }// End Start()
public void FadeOutMusic() { backgroundMusic = GameObject.Find("Main Camera").GetComponent <AudioSource>(); StartCoroutine(FadeMusic.StartFade(backgroundMusic, duration, targetVolume)); }