示例#1
0
        public void BuildHierarchy()
        {
            Transform transform  = this.get_transform();
            int       childCount = transform.get_childCount();

            for (int i = 0; i < childCount; i++)
            {
                DynamicObject component = transform.GetChild(i).GetComponent <DynamicObject>();
                if (null != component)
                {
                    component.m_parent = this;
                    component.BuildHierarchy();
                    m_children.Add(component);
                }
            }
        }
示例#2
0
        private void BuildDynamicObjectsHierarchy(Transform t)
        {
            int childCount = t.get_childCount();

            for (int i = 0; i < childCount; i++)
            {
                Transform     child     = t.GetChild(i);
                DynamicObject component = child.GetComponent <DynamicObject>();
                if (null != component)
                {
                    component.BuildHierarchy();
                    m_rootDynamicChildren.Add(component);
                }
                else
                {
                    BuildDynamicObjectsHierarchy(child);
                }
            }
        }