protected virtual void Awake() { #if UNITY_WEBGL && !UNITY_EDITOR // Force to use websocket transport if it's running as webgl if (transportFactory == null || !transportFactory.CanUseWithWebGL) { transportFactory = gameObject.AddComponent <WebSocketTransportFactory>(); } #else if (useWebSocket) { if (transportFactory == null || !transportFactory.CanUseWithWebGL) { transportFactory = gameObject.AddComponent <WebSocketTransportFactory>(); } } else { if (transportFactory == null) { transportFactory = gameObject.AddComponent <LiteNetLibTransportFactory>(); } } #endif transport = TransportFactory.Build(); if (offlineTransport == null) { offlineTransport = new OfflineTransport(); } Client = new LiteNetLibClient(this); Server = new LiteNetLibServer(this); }