public void PlayerConnected(PlayerNetworked connectedPlayer, bool local, bool host)
    {
        //spawn a lobby entity corresponding to new player
        GameObject go = Instantiate(PlayerLobbyEntityPrefab, transform.GetChild(0).GetChild(1));

        //Set entities PlayerListener to listen to the player who just joined.
        go.GetComponent <LobbyEntityListener>().SetCorrespondingPlayer(connectedPlayer);

        //If it's the local player it needs to be connected to PlayerNetworked to tell them of faction changes.
        if (local)
        {
            localPlayer = connectedPlayer;

            if (host)
            {
                transform.GetChild(0).GetChild(2).GetChild(1).gameObject.SetActive(true); //Give host the "StartGame button"
                localPlayer.Cmd_SetPlayerReadyUnready();                                  //Host starts ready.
            }
            else
            {
                transform.GetChild(0).GetChild(2).GetChild(0).gameObject.SetActive(true); //Give clients the "Ready Up button"
            }
        }
    }
 public void SetPlayerReadyUnready()
 {
     localPlayer.Cmd_SetPlayerReadyUnready();
 }