public void FindGameClick() { // disable the setup party panel, and enable the game lobby panel setupGamePanel.SetActive(false); gameLobbyPanel.SetActive(true); // need to see if the player already has heroes created. if so, destroy them string cleanupUrl = RestUtil.HERO_SERVICE_URI + "cleanup/" + username; Debug.Log("Sending call to : " + cleanupUrl); string cleanupResponse = RestUtil.Instance.Get(cleanupUrl); Debug.Log("Json Response: " + cleanupResponse); // save the player's party data Hero[] party = new Hero[4]; for (int i = 0; i < 4; i++) { party[i] = new Hero(heroName[i].text, username, heroClass[i].options[heroClass[i].value].text); party[i].level = 1; string url = RestUtil.HERO_SERVICE_URI + "create"; Debug.Log("Sending create hero request to: " + url); string jsonData = JsonUtility.ToJson(party[i]); Debug.Log("Hero json data: " + jsonData); string jsonResponse = RestUtil.Instance.Post(url, jsonData).text; Debug.Log("Json Response after creating new hero: " + jsonResponse); } // enable the game lobby and update player list lobbyManager.ConnectToNetwork(); PhotonNetwork.player.NickName = username; }