private IEnumerator CreateMatch(SharedGroupHandler sharedGroupHandler) { var isPlayerOne = ApplicationModel.CurrentPlayer.Entity.Id == ApplicationModel.CurrentMatch.playerOneId; ApplicationModel.CurrentSharedGroupData.sharedGroupId = $"{ApplicationModel.CurrentMatch.playerOneId}-{ApplicationModel.CurrentMatch.playerTwoId}"; Debug.Log(ApplicationModel.CurrentSharedGroupData.sharedGroupId); if (isPlayerOne) { yield return(sharedGroupHandler.Create(ApplicationModel.CurrentSharedGroupData.sharedGroupId)); } else { var matchHandler = new MatchHandler(ApplicationModel.CurrentPlayer, ApplicationModel.CurrentSharedGroupData.sharedGroupId); while (string.IsNullOrWhiteSpace(matchHandler.TicTacToeSharedGroupData?.match?.playerTwoId) && LookingForMatch) { Debug.Log("Joining to match"); yield return(matchHandler.JoinMatch()); yield return(new WaitForSeconds(Constants.RETRY_GET_LOBBY_INFO_AFTER_SECONDS)); } } }