public void AddChild(ListViewNode child)
 {
     if (Children == null)
     {
         Children = new List <ListViewNode>();
     }
     Children.Add(child);
 }
        protected override TreeViewItem BuildRoot()
        {
            entityById.Clear();
            var currentId = kAllEntitiesItemId + 1;

            rootNode = new ListViewNode(new TreeViewItem()
            {
                id = currentId++, displayName = "Root"
            });
            if (Application.isPlaying)
            {
                var debugGroup = _groupSelectionGetter();
                //todo
                if (debugGroup != null)
                {
                    var entities = debugGroup.DebugEntities;
                    if (entities.Count > 0)
                    {
                        foreach (var debugEntity in entities)
                        {
                            var id = currentId++;
                            entityById.Add(id, debugEntity);
                            var node = new ListViewNode(new TreeViewItem
                            {
                                id = id, displayName = $"Entity UnityId: {unchecked((int)debugEntity.Id)}; Svelto UInt Id:{debugEntity.Id}"
                            });
                            rootNode.AddChild(node);
                        }
                    }
                }
            }

            var root = rootNode.BuildList();

            if (!root.hasChildren)
            {
                root.children = new List <TreeViewItem>(0);
            }

            root.depth = -1;

            SetupDepthsFromParentsAndChildren(root);
            return(root);
        }
Exemple #3
0
        protected override TreeViewItem BuildRoot()
        {
            groupsById.Clear();
            var currentId = kAllEntitiesItemId + 1;

            rootNode = new ListViewNode(new TreeViewItem()
            {
                id = currentId++, displayName = "Root"
            });
            if (Application.isPlaying)
            {
                var debugRoot = _rootSelectionGetter();
                //todo
                if (debugRoot != null)
                {
                    var groups = debugRoot.DebugGroups;
                    if (groups.Count > 0)
                    {
                        foreach (var debugGroup in groups)
                        {
                            var id = currentId++;
                            groupsById.Add(id, debugGroup);
                            var node = new ListViewNode(new TreeViewItem
                            {
                                id = id, displayName = Debugger.GetNameGroup(debugGroup.Id)
                            });
                            rootNode.AddChild(node);
                        }
                    }
                }
            }

            var root = rootNode.BuildList();

            if (!root.hasChildren)
            {
                root.children = new List <TreeViewItem>(0);
            }

            root.depth = -1;

            SetupDepthsFromParentsAndChildren(root);
            return(root);
        }
 private void RebuildNodes()
 {
     rootNode = null;
     Reload();
 }