IsConnectedAndReady and WaitUntil

benjamin
benjamin
edited April 2017 in Photon Voice
Hello,

I noticed an issue using WaitUntil with the PhotonVoiceNetwork.instance.client.IsConnectedAndReady.

The following method log false.
private IEnumerator Init()
{
yield return new WaitUntil(() => PhotonVoiceNetwork.instance.client.IsConnectedAndReady);
Debug.Log(PhotonVoiceNetwork.instance.client.IsConnectedAndReady);
}
While the following method log true.
private IEnumerator Init()
{
while (!PhotonVoiceNetwork.instance.client.IsConnectedAndReady)
    yield return null;
Debug.Log(PhotonVoiceNetwork.instance.client.IsConnectedAndReady);
}
I think it should work, but don't know why it doesn't.

Thanks for your future answer.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @benjamin,

    Thank you for choosing Photon!

    This is probably a Unity related issue.
    We will investigate further if we have time.
    I guess it is not a showstopper for you but you are just curious :)
  • Thanks @JohnTube ,

    Of course it's not an issue, I get around with the second method.