Earlier, I asked the question how to end a level. It was solved with the following script:
Now, I want to add a sound to it. What I've attempted doing is creating a variable called triumph, and then using the audio.PlayOneShot code. However, this never plays it, and actually prevents the player from moving to the next level. I'm not sure how to add the sound to it. The sound is named Pop! Triumph! and it doesn't loop. Also, I'm not going to use any other sound, so it doesn't have to be a variable.
So can anyone make an addition to this script to make the sound play?
asked Jun 22 '10 at 08:34 AM
I'll give u a C# verison, the sound file has to be in ur "Resources" Folder.
answered Jun 22 '10 at 08:50 AM
The problem is that the sound will be stopped when you try to load the next level
What I would do is play a sound (using audio.Play, not PlayOneShot), and wait until audio.IsPlaying is false. After that, load the level like you normally would
answered Jun 22 '10 at 01:15 PM