private void OnApplicationFocus(bool focus)
{
playerState = focus;
if (!isOnlineMode)
{
return;
}
if (focus)
{
Debug.Log("Application resume");
if (opponentState)
{
Time.timeScale = 1f;
}
WhotUiManager.instance.connecting.SetActive(true);
StartCoroutine(checkPoolStatus());
if (PhotonNetwork.room != null)
{
WhotUiManager.instance.connecting.SetActive(false);
PhotonNetwork.RaiseEvent(152, 1, true, null);
PhotonNetwork.SendOutgoingCommands();
}
}
else
{
// playerState = false;
Debug.Log("Application pause");
WhotUiManager.instance.connecting.SetActive(true);
Time.timeScale = 0f;
PhotonNetwork.RaiseEvent(151, 1, true, null);
PhotonNetwork.SendOutgoingCommands();
}
}