Ejemplo n.º 1
0
    private void SetupPlayer(NetworkingPlayer np, string name, ulong customization)
    {
        MainThreadManager.Run(() => {
            int playerCount = m_LobbyPlayers.Count;

            LobbyPlayer player = NetworkManager.Instance.InstantiateLobbyPlayer() as LobbyPlayer;

            player.networkStarted += (NetworkBehavior behavior) =>
            {
                // Position setup
                player.UpdatePosition(playerCount);

                // Customization setup
                player.SetCustomization(customization);

                // Name setup
                player.UpdateName(name);
            };

            m_LobbyPlayers.Add(np, player);
        });
    }