Inheritance: UnityEngine.Networking.NetworkLobbyPlayer, IPlayerAction
    public void AddPlayer(PlayerLobby player)
    {
        if (players.Contains(player))
        {
            return;
        }

        players.Add(player);

        if (playerListContentTransform != null)
        {
            player.transform.SetParent(playerListContentTransform, false);
            RectTransform playerRect = player.GetComponent <RectTransform>();
            playerRect.sizeDelta = new Vector2(playerListContentTransform.rect.width, playerRect.sizeDelta.y);
            playerListContentTransform.sizeDelta = new Vector2(playerListContentTransform.sizeDelta.x, players.Count * playerRect.sizeDelta.y);
        }

        if (addButtonRow != null)
        {
            addButtonRow.transform.SetAsLastSibling();
        }

        PlayerListModified();
    }
示例#2
0
	void Awake()
	{
		lobbyPlayer = GetComponent<NetworkLobbyPlayer>();
		playerUI = GetComponent<PlayerLobby>();
	}
 public void RemovePlayer(PlayerLobby player)
 {
     players.Remove(player);
     PlayerListModified();
 }
 void Awake()
 {
     lobbyPlayer = GetComponent <NetworkLobbyPlayer>();
     playerUI    = GetComponent <PlayerLobby>();
 }
 public SingleGame(PlayerLobby activeLobby)
 {
     _started  = false;
     MyPlayers = new List <Player>();
     MyPlayers = activeLobby.Player;
 }
示例#6
0
	public void RemovePlayer(){
		player = null;
		titleText.text = "No Player";
	}
示例#7
0
	public void SetPlayer(PlayerLobby play){
		player = play;
		titleText.text = "Player " + play.slot;
	}
示例#8
0
 public void RemovePlayer(PlayerLobby player)
 {
     player.RemovePlayer();
 }
示例#9
0
 public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
 {
     PlayerLobby lobby = lobbyPlayer.GetComponent <PlayerLobby>();
 }