Exemplo n.º 1
0
    public override void OnServerAddPlayer(NetworkConnection conn)
    {
        //Performs all base logic of the overrided class
        base.OnServerAddPlayer(conn);

        SwitchPlayer player = conn.identity.GetComponent <SwitchPlayer>();

        Players.Add(player);

        player.SetDisplayName($"Player{Players.Count}");

        player.SetPartyOwner(Players.Count == 1);
    }