void InitNetwork() { WSServerState.Reset(); if (DebugStandalone) { WSServer.Stop(); WSServerState.Reset(); WSClient.Disconnect(); WSClientState.Reset(); WSServer.StartFake(); WSClient.ConnectFake(); } else if (IsClient) { WSServer.Stop(); WSServerState.Reset(); WSClient.Connect(); } else { WSClient.Disconnect(); WSClientState.Reset(); if (!WSServer.IsRunning) { WSServer.Start(); } } }
void OnApplicationQuit() { WSServer.Stop(); WSClient.Disconnect(); }
private void OnDestroy() { if (TCPClientState.Connected) tcpClient.Disconnect(); if (UDPClientState.Connected) udpClient.Disconnect(); if (WSClientState.Connected) wsClient.Disconnect(); }