- Home /
Fullscreen does not pause music - Windows 7
I'm using Unity 3.0.0f5, on Windows 7, 32bit Home Premium.
I've compiled a project to an EXE, and ran the game in fullscreen. If I then alt-tab, or press the Windows key or do other things to move away from the game, the music continues to play, while it should pause instead.
The OnApplicationFocus and OnApplicationPause functions doesn't get called either.
It works fine while in Windowed mode though, but not fullscreen mode. I haven't tried it on Unity 2 but I assume it works fine there.
I'm starting the music in Start() on my scene using this code:
public AudioSource TheMusic;
TheMusic.Play();
Have anyone else experienced this, or is it something in my project? I've created a very simple project that simply plays a song too, and it happened there, on all my Windows computers...
I've tried to manually detect when focus is lost by using Win32 DLL functions, but it doesn't seem to work all the time.
Thanks!
Your answer
Follow this Question
Related Questions
Music On/Off Switch 2 Answers
Pause game when user pulls down the notification panel 0 Answers
Play music while game is starting 2 Answers
How to prevent the game from pausing on alt-tab 1 Answer
Navigate Without Focus? 0 Answers