/// <summary>
    /// Removes the team in the event of a player leaving.
    /// </summary>
    /// <param name="thingtoadd">The left players PhotonID.</param>
    /// <param name="teamkey">The left players Team</param>
    public void removetoteam(int thingtoadd, string teamkey)
    {
        List <int> templist = LobbyScreenController.getteaminput(teamkey);

        if (templist.Contains(thingtoadd) == true)
        {
            templist.Remove(thingtoadd);
        }
        LobbyScreenController.setteaminput(templist, teamkey);
        Debug.Log("removed: " + thingtoadd + " from " + teamkey);
    }
    /// <summary>
    /// Asign the current player to a team after the match starts.
    /// </summary>
    /// <param name="thingtoadd">The players PhotonID</param>
    /// <param name="teamkey">The team to add the PhotonID too.</param>
    public void addtoteam(int thingtoadd, string teamkey)
    {
        List <int> templist       = LobbyScreenController.getteaminput(teamkey);
        int        maxplayerstemp = PhotonNetwork.room.MaxPlayers;

        if (maxplayerstemp == 4 && (string)PhotonNetwork.room.CustomProperties["3v3"] == "Yes")
        {
            maxplayerstemp = 6;
        }
        int maxplayersperteam = maxplayerstemp / 2;

        if (templist.Count <= maxplayersperteam)
        {
            if (templist.Contains(thingtoadd) == false)
            {
                templist.Add(thingtoadd);
            }
        }
        else
        {
            Debug.Log("ERROR: TEAM FULL");
        }
        LobbyScreenController.setteaminput(templist, teamkey);
    }