public static void Close() { Clear(); m_Client.Close(); m_Client = null; EditorApplication.update -= Tick; }
public ChannelClientScope(bool autoTick, string channelName, ChannelClientBinaryHandler handler, bool closeClientOnExit = true) { m_CloseClientOnExit = closeClientOnExit; client = ChannelClient.GetOrCreateClient(channelName); m_Off = client.On(handler); client.Start(autoTick); }
public static void Start() { if (m_Client != null || IsConnected) { return; } m_Client = ChannelClient.GetOrCreateClient("event"); m_Client.On(IncomingEvent); m_Client.Start(false); int tickCount = 100; while (!m_Client.IsConnected() && --tickCount > 0) { m_Client.Tick(); System.Threading.Thread.Sleep(10); } EditorApplication.update += Tick; }