private void AddChildren(rdtGuiTree <rdtTcpMessageGameObjects.Gob> .Node parentNode, List <rdtTcpMessageGameObjects.Gob> nonRoots)
 {
     for (int i = 0; i < nonRoots.Count; i++)
     {
         rdtTcpMessageGameObjects.Gob data = nonRoots[i];
         if (data.m_parentInstanceId == parentNode.Data.m_instanceId)
         {
             rdtGuiTree <rdtTcpMessageGameObjects.Gob> .Node node = parentNode.AddNode(data, data.m_enabled);
             this.AddChildren(node, nonRoots);
         }
     }
 }
        private void BuildTree()
        {
            List <rdtTcpMessageGameObjects.Gob> list = Enumerable.ToList <rdtTcpMessageGameObjects.Gob>(Enumerable.Where <rdtTcpMessageGameObjects.Gob>(this.m_gameObjects, delegate(rdtTcpMessageGameObjects.Gob x) {
                return(!x.m_hasParent);
            }));
            List <rdtTcpMessageGameObjects.Gob> nonRoots = Enumerable.ToList <rdtTcpMessageGameObjects.Gob>(Enumerable.Where <rdtTcpMessageGameObjects.Gob>(this.m_gameObjects, delegate(rdtTcpMessageGameObjects.Gob x) {
                return(x.m_hasParent);
            }));

            for (int i = 0; i < list.Count; i++)
            {
                rdtTcpMessageGameObjects.Gob data = list[i];
                rdtGuiTree <rdtTcpMessageGameObjects.Gob> .Node parentNode = this.m_tree.AddNode(data, data.m_enabled);
                this.AddChildren(parentNode, nonRoots);
            }
        }
Exemple #3
0
        private void AddGameObject(GameObject g, List <rdtTcpMessageGameObjects.Gob> list)
        {
            rdtTcpMessageGameObjects.Gob item = new rdtTcpMessageGameObjects.Gob();
            item.m_name       = g.name;
            item.m_instanceId = g.GetInstanceID();
            Transform parent = g.transform.parent;

            item.m_hasParent = parent != null;
            if (item.m_hasParent)
            {
                item.m_parentInstanceId = parent.gameObject.GetInstanceID();
            }
            item.m_enabled = g.activeInHierarchy;
            list.Add(item);
            for (int i = 0; i < g.transform.childCount; i++)
            {
                Transform child = g.transform.GetChild(i);
                this.AddGameObject(child.gameObject, list);
            }
        }
Exemple #4
0
 public override bool Equals(object obj)
 {
     rdtTcpMessageGameObjects.Gob gob = (rdtTcpMessageGameObjects.Gob)obj;
     return(this.m_instanceId == gob.m_instanceId);
 }