How do I get OnApplicationPause to trigger?

When I run my project in the editor I first get a call to OnApplicationPause with false which seems ok. But when pressing the pause-button in the editor I don’t get any call to OnApplicationPause. I expected a call with true this time.

Do I have to have “Run in background” unchecked for this to work?

The problem I’m having with that is that the checkbox keeps check itself whenever I run the project, then go back to unchecked again when I stop it.

I’m using Unity 4.6.2

Simply

#CLICK ON THE DESKTOP OF YOUR MAC OR PC

it’s that simple.

OnApplicationPause is not going to be called, if you pause the project in Unity simply because, when you pause it, everything in your game pauses. When running the game in the editor press ALT + TAB, to switch to another window, or just minimize Unity down and then reveal it again. This way the application continues to work and it knows that it was pulled down. If you pause the editor, everything pauses and there is no way, that the code knows, if it was paused…