There are lots of answers suggesting using OnApplicationPause for doing stuff when the application goes out of focus (for instance, when the Home button on the iPhone is pushed).
We don't see that this function is called.
Does this in fact work, or do you need magic to make it so? If not, why does so many answers suggest it, and how do those answer get accepted?
Edit: And why is none of this in the documentation, Unity guys?
Edit: We need a solution for iPhone (and Android).
More info: The OnApplicationPause does get called for PC (with RunInBackground switched off), and on iPhone when we put it in the class that directly extends from Monobehaviour (in our system, called DebuggableManobehaviour), but not in any classes that extend from DebuggableManobehaviour (which is all the game classes in our project).
If the player is paused, OnApplicationPause should be called. If it isn't, that's a bug, you should file it. Is your player actually pausing? Maybe you have the run in Background checkbox enabled?
answered Jan 19 '11 at 02:26 PM
jonas echterhoff ♦♦