check Player setting => Resolution => (Run In Background)
OnApplicationPause/OnApplicationFocus has been all over the place for me. In the Editor, it seems to be different on PC and MAC. On MAC it seems to get called on press Play. On PC it doesn't. On iOS it seems like one of them doesn't work. Can somebody tell me the different scenarios that they work?
And can somebody explain what they mean in each scenario? Editor? Standalone? iOS? Android? (like does OnApplicationFocus fire when you minimize or when you just click on another window in the Editor)
I know about the documentation, I read the documentation. But the behavior doesn't match it. It's ridiculous. If somebody has figured it out I'd greatly appreciate it.
Since this UnityAnswer is one of the first (if not the first) to be returned on a search for OnApplicationFocus/Pause & iOS, an important update in Unity 4.6.1 has changed the behavior for iOS.
As of 4.6.1, both OnApplicationFocus and OnApplicationPause will be called in iOS.
The order is :
App initially starts:
OnApplicationFocus(true) is called
App is soft closed:
OnApplicationFocus(false) is called
OnApplicationPause(true) is called
App is brought forward after soft closing:
OnApplicationPause(false) is called
OnApplicationFocus(true) is called
Hope that helps
http://answers.unity3d.com/questions/496290/can-somebody-explain-the-onapplicationpausefocus-s.html
'게임엔진(GameEngine) > Unity3D' 카테고리의 다른 글
리소스 로딩하기 (특별한 폴더 resources) (0) | 2017.08.25 |
---|---|
unity license information is invalid 뜰때 해결 (0) | 2017.08.17 |
유니티 Start, Awake, OnEnable 의 활성화 비활성화의 관계 (0) | 2017.07.13 |
Reflection Unity C#리플렉션 (0) | 2017.07.11 |
Awake, OnEnable, Start 순서로 호출 (2) | 2017.06.28 |