private void OnMessageGameObjects(rdtTcpMessage message)
        {
            rdtTcpMessageGameObjects objects = (rdtTcpMessageGameObjects)message;

            this.m_gameObjects = objects.m_allGobs;
            this.m_tree.Clear();
            this.BuildTree();
            if (this.m_selected.HasValue)
            {
                this.m_tree.SetSelected(this.m_selected.Value, true, false, false);
            }
            else
            {
                this.m_tree.ClearSelected(true, false, false);
            }
            base.Repaint();
        }
Exemple #2
0
        private void OnRequestGameObjects(rdtTcpMessage message)
        {
            rdtTcpMessageGameObjects objects = new rdtTcpMessageGameObjects();

#if UNITY_5
            Scene activeScene = SceneManager.GetActiveScene();
            if (activeScene.rootCount > this.m_gameObjects.Capacity)
            {
                this.m_gameObjects.Capacity = activeScene.rootCount;
            }
            this.m_gameObjects.Clear();
            activeScene.GetRootGameObjects(this.m_gameObjects);
#else
            m_gameObjects.Clear();
            Transform[] allTrans = GameObject.FindObjectsOfType <Transform>();
            for (int ii = 0; ii < allTrans.Length; ++ii)
            {
                Transform tran = allTrans[ii];
                if (tran.parent != null)
                {
                    continue;
                }
                m_gameObjects.Add(tran.gameObject);
            }
#endif
            int count = this.m_gameObjects.Count;
            List <GameObject> gameObjects = this.m_gameObjects;
            if (count > this.m_allGobs.Capacity)
            {
                this.m_allGobs.Capacity = count;
            }
            this.m_allGobs.Clear();
            for (int i = 0; i < count; i++)
            {
                GameObject g = gameObjects[i];
                if ((g.hideFlags == HideFlags.None) && (g.transform.hideFlags == HideFlags.None))
                {
                    this.AddGameObject(g, this.m_allGobs);
                }
            }
            objects.m_allGobs = this.m_allGobs;
            this.m_server.EnqueueMessage(objects);
            this.m_gameObjects.Clear();
        }