OnApplicationFocus called twice?

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”);
}

}

I’m having the same issue. Any news?

Focus is call twice , when you loose focus, and when you get it :slight_smile:

( I think ! Not 100%)

You are correct https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationFocus.html as stated in the official docs. It’s called when you lose or gain focus.