示例#1
0
    public void EndGame(string winner)
    {
        Debug.Log("EndGame");
        //STOP GAME PLAYING
        gamePlaying = false;
        gameIsOver  = true;


        //DESTROY PLAYERS
        respawnManager.DestroyAllPlayers();

        //CHANGE TEXT TO SHOW WHO WON (and play audio)
        if (winner == "WHITE")
        {
            countdownDisplay.color = new Color(255, 255, 255);
        }
        else if (winner == "BLACK")
        {
            countdownDisplay.color = new Color(0, 0, 0);
        }
        countdownDisplay.text = winner + " WINS!";
        countdownDisplay.gameObject.SetActive(true);

        //DISPLAY TEXT TO RESTART GAME
        playAgainDisplay.text = "Play Again? (Press X + A)";
    }