コード例 #1
0
 public static void Close()
 {
     Clear();
     m_Client.Close();
     m_Client = null;
     EditorApplication.update -= Tick;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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;
        }