void OnPlayerConnected(int playerId, Hash128 buildSettingsGuid)
        {
            var connectedPlayer = EditorConnection.instance.ConnectedPlayers.Find(x => x.playerId == playerId);

            if (connectedPlayer == null)
            {
                return;
            }

            var existingConnection = m_LinkConnections.FirstOrDefault(x => x.PlayerId == playerId);

            if (existingConnection != null)
            {
                existingConnection.Reset(connectedPlayer.name, LiveLinkConnectionStatus.Connected, buildSettingsGuid);
            }
            else
            {
                m_LinkConnections.Add(new LiveLinkConnection(connectedPlayer.playerId, connectedPlayer.name, LiveLinkConnectionStatus.Connected, buildSettingsGuid));
            }

            if (m_IsOpen)
            {
                GenerateUiFromState();
            }

            LiveLinkToolbar.RepaintPlaybar(); // to repaint the dropdown button itself
        }
        static void DisconnectPlayer(EventBase e, LiveLinkConnection connection)
        {
            var previousCls = GetStatusClass(connection.Status);
            var target      = (VisualElement)e.target;

            connection.Status = LiveLinkConnectionStatus.SoftDisconnected;
            target.RemoveFromClassList(previousCls);
            target.AddToClassList(GetStatusClass(connection.Status));

            EditorSceneLiveLinkToPlayerSendSystem.instance.DisableSendForPlayer(connection.PlayerId);

            LiveLinkToolbar.RepaintPlaybar(); // to repaint the dropdown button itself
        }
        void OnPlayerConnected(int playerId)
        {
            if (m_LinkConnections.Any(x => x.PlayerId == playerId))
            {
                return;
            }

            var connectedPlayer = EditorConnection.instance.ConnectedPlayers.Find(x => x.playerId == playerId);

            if (connectedPlayer == null)
            {
                return;
            }

            m_LinkConnections.Add(new LiveLinkConnection(connectedPlayer.playerId, connectedPlayer.name, LiveLinkConnectionStatus.Connected));
            LiveLinkToolbar.RepaintPlaybar();
        }
 void OnPlayerDisconnected(int playerId)
 {
     m_LinkConnections.RemoveAll(x => x.PlayerId == playerId);
     LiveLinkToolbar.RepaintPlaybar();
 }
 void OnPlayerDisconnected(int playerId)
 {
     m_LinkConnections.RemoveAll(x => x.PlayerId == playerId);
     LiveLinkToolbar.RepaintPlaybar(); // to repaint the dropdown button itself
 }