public int RemovePlayer()

in UltraFrogRoyale/Assets/GameManager.cs [109:131]


    public int RemovePlayer(GamePlayerController playerController)
    {
        var stat = new GameOverStat();
        stat.playerName = playerController.GetPlayerName();
        stat.size = playerController.GetPlayerSize();
        stat.place = playerList.Count;
        stats.Add(stat);
        playerList.Remove(playerController);
        // Since the leaderboard is only updated when a player is removed
        // detect when the last player is standing and add to the leaderboard
        if (playerList.Count == 1)
        {
            var winner = playerList[0];
            stat = new GameOverStat();
            stat.playerName = winner.GetPlayerName();
            stat.size = winner.GetPlayerSize();
            stat.place = 1;
            stats.Add(stat);
            // last player standing means the game is won and the session should terminate
            networkManager.TerminateSession();
        }
        return playerList.Count;
    }