Hi to all, I have a problem in OnApplication focus and pause, when i pause the game,On applicationPause is not triggered but when I focus the game, OnApplicationFocus is triggered twice. Here is my code below.
bool isPaused = false;
void OnApplicationFocus(bool hasFocus)
{
isPaused = !hasFocus;
if (hasFocus) {
Debug.Log(“On application focus”);
}
}
void OnApplicationPause(bool hasPause)
{
isPaused = hasPause;
if (isPaused) {
Debug.Log(“On application pause”);
}
}