コード例 #1
0
    void CompleteGame(bool timeIsEnd)
    {
        //Stop the game
        gameOver = true;

        //Create message box
        var gameOverMessageBoxLink = Instantiate(gameOverMessageBox);
        var gameOverText           = gameOverMessageBoxLink.GetComponentInChildren <Text>();

        //If player was 1
        if ((byte)PhotonNetwork.CurrentRoom.CustomProperties[RoomOptionKeys.PlayersInRoom] == 1)
        {
            gameOverText.text = GameEndTextFor1PlayerGames;
            return;
        }

        //If players were many
        gameOverText.text = rating.AmIFist() ? GameWonText : GameLoseText;
        if (!timeIsEnd)
        {
            gameOverText.text += Environment.NewLine + AllPlayersDisconnectSuffix;
        }
    }