mirror of
https://github.com/Ratstail91/Keep-It-Alive.git
synced 2025-11-29 02:24:27 +11:00
21 lines
535 B
C#
21 lines
535 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class FireGoesOut : MonoBehaviour {
|
|
AudioController audioController;
|
|
|
|
void Awake() {
|
|
audioController = GameObject.Find("AudioController").GetComponent<AudioController>();
|
|
|
|
StartCoroutine(SwitchScenesAfter("MainMenu", 3f));
|
|
|
|
audioController.StopAll();
|
|
}
|
|
|
|
IEnumerator SwitchScenesAfter(string sceneName, float delay) {
|
|
yield return new WaitForSeconds(delay);
|
|
SceneManager.LoadScene(sceneName);
|
|
}
|
|
} |