コード例 #1
0
        private void Update()
        {
            if ((EditorApplication.isCompiling && (this.m_client != null)) && this.m_client.IsConnected)
            {
                this.Disconnect(false);
            }
            if (!this.m_running)
            {
                this.OnUnityReloadedAssemblies();
            }
            double timeSinceStartup = EditorApplication.timeSinceStartup;
            double delta            = timeSinceStartup - this.m_lastTime;

            this.m_lastTime = timeSinceStartup;
            this.UpdateServers(delta);
            if (this.m_serverEnum.Stopped)
            {
                this.m_serverEnum = new rdtClientEnumerateServers();
            }
            this.m_tree.Update();
            if (this.m_client != null)
            {
                bool isConnected  = this.m_client.IsConnected;
                bool isConnecting = this.m_client.IsConnecting;
                this.m_client.Update(delta);
                if ((this.m_client.IsConnected != isConnected) || ((!this.m_client.IsConnected && !this.m_client.IsConnecting) && isConnecting))
                {
                    this.OnConnectionStatusChanged();
                }
                this.m_gameObjectRefreshTimer -= delta;
                if (this.m_gameObjectRefreshTimer <= 0.0)
                {
                    this.m_client.EnqueueMessage(new rdtTcpMessageGetGameObjects());
                    this.m_gameObjectRefreshTimer = rdtSettings.GAMEOBJECT_UPDATE_TIME;
                }
                if (this.m_selected.HasValue)
                {
                    this.m_componentRefreshTimer -= delta;
                    if (this.m_componentRefreshTimer <= 0.0)
                    {
                        rdtTcpMessageGetComponents message = new rdtTcpMessageGetComponents();
                        message.m_instanceId = this.m_selected.Value.m_instanceId;
                        this.m_client.EnqueueMessage(message);
                        this.m_componentRefreshTimer = rdtSettings.COMPONENT_UPDATE_TIME;
                    }
                }
            }
        }
コード例 #2
0
 private void OnUnityReloadedAssemblies()
 {
     rdtDebug.Debug(this, "OnUnityReloadedAssemblies", new object[0]);
     rdtDebug.s_logLevel = this.m_debug ? rdtDebug.LogLevel.Debug : rdtDebug.LogLevel.Info;
     this.m_running      = true;
     if (this.m_serverEnum != null)
     {
         this.m_serverEnum.Stop();
     }
     this.m_serverEnum = new rdtClientEnumerateServers();
     if (this.m_currentServer != null)
     {
         if (this.m_currentServer.IPAddress == null)
         {
             this.m_currentServer = null;
         }
         else
         {
             this.Connect(this.m_currentServer);
         }
     }
 }