Beispiel #1
0
 public void Disconnect()
 {
     if (m_Connection == null)
     {
         m_Cancellation?.Cancel();
         m_Cancellation = null;
     }
     else
     {
         if (!m_Connection.Disposed)
         {
             m_Connection.BroadcastDisconnect();
             m_Connection     = null;
             m_HostConnection = null;
         }
         OnDisconnect?.Invoke();
     }
 }
Beispiel #2
0
 public void StartHost(string roomName)
 {
     Disconnect();
     SetConnection(m_HostConnection = Connection.StartLocalHost(roomName));
 }