Ejemplo n.º 1
0
    public void AddPlayer(Player newPlayer)
    {
        players.Add(newPlayer);

        if (lobbyList == null)
        {
            lobbyList = FindObjectOfType <UI_LobbyList>();
        }

        lobbyList.AddEntry(newPlayer.lobbyEntryPrefab);
    }
Ejemplo n.º 2
0
    //--------------------------------
    //---- Network Communication -----
    //--------------------------------
    #region unet
    // [SyncVar] hook -> playerNumber
    void PlayerNumberChanged(int value)
    {
        GetComponentInChildren <PlayerStyle>().SetColor(playerNumber);

        playerNumber = value;
        UI_LobbyList lobbyList = FindObjectOfType <UI_LobbyList>();

        if (lobbyList == null)
        {
            return;
        }
        lobbyList.UpdateEntries();
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        players   = new List <Player>();
        lobbyList = FindObjectOfType <UI_LobbyList>();


        if (SceneLogic.isServer)
        {
            NW_ManagerAdapter.Instance.StartHost();
        }
        else
        {
            NW_BroadcastingAdapter.Instance.StartListening();
        }
    }