IEnumerator SetTimeline() { using (UnityWebRequest www = UnityWebRequest.Get(URLs.GetMatchTimeline(match.gameId))) { yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { print("Error: " + www.error); } else { timeline = JsonConvert.DeserializeObject <MatchTimeline>(www.downloadHandler.text); MapGenerator mapGen = tabs[1].GetComponent <MapGenerator>(); mapGen.match = match; mapGen.timeline = timeline; mapGen.SetupUI(playerParticipantId); } } }