public void RequestGameList() { if (!IsGameListRequestPending) { AsyncJSONRequest gameListRequest = AsyncJSONRequest.Create(m_selectGameController.gameObject); IsGameListRequestPending = true; gameListRequest.GET( ServerConstants.gameListRequestURL, (AsyncJSONRequest asyncRequest) => { if (asyncRequest.GetRequestState() == AsyncJSONRequest.eRequestState.succeded) { JsonData response = asyncRequest.GetResult(); string responseResult = (string)response["result"]; if (responseResult == "Success") { SessionData sessionData = SessionData.GetInstance(); JsonData gamesList = response["game_list"]; sessionData.GameList = new List <GameResponseEntry>(); for (int listIndex = 0; listIndex < gamesList.Count; listIndex++) { sessionData.GameList.Add(GameResponseEntry.FromObject(gamesList[listIndex])); } if (sessionData.GameList.Count > 0) { SelectedListIndex = 0; } m_selectGameController.OnGameListUpdated(); } else { m_selectGameController.OnRequestFailed(responseResult); Debug.LogError("Get Game List Failed: " + asyncRequest.GetFailureReason()); } } else { m_selectGameController.OnRequestFailed("Connection Failure!"); Debug.LogError("Get Game List Failed: " + asyncRequest.GetFailureReason()); } IsGameListRequestPending = false; }); } }