コード例 #1
0
ファイル: MatchPrefab.cs プロジェクト: mAxYoLo01/OPGG
    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);
            }
        }
    }