Exemplo n.º 1
0
    protected override void OnMatchInfoDownloaded(MatchInfo matchInfo)
    {
        if (matchInfo.state != "OK") {
            int matchId = eventInfo.matchId;
            StartCoroutine (DownloadMatchInfo (matchId));
            return;
        }

        Bot winner = matchInfo.GetWinner();

        if (winner == null) {
            winnerText.text = "Draw!";

            Bot[] bots = matchInfo.bots;

            player1Text.text = createText (bots[0].name, -1);
            player2Text.text = createText (bots[1].name, -1);
        } else {
            winnerText.text = winner.name + " wins!";

            Bot looser = matchInfo.GetLooser ();

            player1Text.text = createText (winner.name, 3);
            player2Text.text = createText (looser.name, 0);
        }

        int tournamentId = matchInfo.tournamentId;
        StartCoroutine(DownloadUpcomingMatches(tournamentId));
    }