i am trying to make it so once a button is pressed it plays a sound before changing scenes. heres my code atm
#pragma strict
function ChangeToScene(sceneName : String) {
GetComponent(AudioSource).Play();
Application.LoadLevel(sceneName);
}
function QuitGame() {
GetComponent(AudioSource).Play();
Application.Quit();
}
i want it to play the sound before it switches scenes. thnx