public ChannelClientScope(bool autoTick, string channelName, Action <byte[]> handler, bool closeClientOnExit = true) { m_CloseClientOnExit = closeClientOnExit; client = ChannelClient.GetOrCreateClient(channelName); m_Off = client.RegisterMessageHandler(handler); client.Start(autoTick); }
public static void Start() { if (m_Client != null || isConnected) { return; } m_Client = ChannelClient.GetOrCreateClient("event"); m_Client.RegisterMessageHandler(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; }