Example #1
0
    public void CreatePlayer(int id, string name)
    {
        LobbyPlayer p = Instantiate(playerPrefab, playersList, false);

        p.Init();
        p.SetPlayer(id, name);

        Players.Add(p);
    }
Example #2
0
    public void CreatePlayer(LiteNetLib.NetPeer peer, string name, bool self)
    {
        LobbyPlayer p = Instantiate(playerPrefab, playersList, false);

        p.Init();
        p.SetPlayer(peer, name, self, Players.Count);

        Players.Add(p);
    }
Example #3
0
 /// <summary>
 /// Create our lobby object
 /// </summary>
 private void CreateLobbyObject()
 {
     LobbyObject = Instantiate(_lobbyPrefab).GetComponent <LobbyPlayer>();
     LobbyObject.Init(this);
 }