Example #1
0
        protected override IList <TreeViewItem> BuildRows(TreeViewItem root)
        {
            if (!ShowingSomething)
            {
                return(new List <TreeViewItem>());
            }

            var entityManager = getWorldSelection().GetExistingManager <EntityManager>();

            if (chunkArray.IsCreated)
            {
                chunkArray.Dispose();
            }

            entityManager.CompleteAllJobs();

            if (SelectedEntityQuery == null || SelectedEntityQuery.Group == null)
            {
                var query = SelectedEntityQuery?.Query ?? allQuery;
                chunkArray = entityManager.CreateArchetypeChunkArray(query, Allocator.Persistent);
            }
            else
            {
                chunkArray = SelectedEntityQuery.Group.CreateArchetypeChunkArray(Allocator.Persistent);
            }

            rows.SetSource(chunkArray, entityManager, chunkFilter);
            return(rows);
        }
        protected override IList <TreeViewItem> BuildRows(TreeViewItem root)
        {
            if (!ShowingSomething)
            {
                return(new List <TreeViewItem>());
            }

            var entityManager = getWorldSelection().EntityManager;

            if (chunkArray.IsCreated)
            {
                chunkArray.Dispose();
            }

            entityManager.CompleteAllJobs();

            var group = default(EntityQuery);

            if (SelectedEntityQuery != null)
            {
                group = SelectedEntityQuery.Group;
            }

            if (group == default || !entityManager.IsQueryValid(group))
            {
                var query = SelectedEntityQuery?.QueryDesc;
                if (query == null)
                {
                    group = entityManager.UniversalQuery;
                }
                else
                {
                    group = entityManager.CreateEntityQuery(query);
                }
            }

            chunkArray = group.CreateArchetypeChunkArray(Allocator.Persistent);

            rows.SetSource(chunkArray, entityManager, chunkFilter);
            setChunkArray(chunkArray);

            lastVersion = entityManager.Version;

            return(rows);
        }
Example #3
0
        protected override IList <TreeViewItem> BuildRows(TreeViewItem root)
        {
            if (!ShowingSomething)
            {
                return(new List <TreeViewItem>());
            }

            var entityManager = getWorldSelection().GetExistingManager <EntityManager>();

            if (chunkArray.IsCreated)
            {
                chunkArray.Dispose();
            }

            entityManager.CompleteAllJobs();

            var group = SelectedEntityQuery?.Group;

            if (group == null)
            {
                var query = SelectedEntityQuery?.Query;
                if (query == null)
                {
                    group = entityManager.UniversalGroup;
                }
                else
                {
                    group = entityManager.CreateComponentGroup(query);
                }
            }

            chunkArray = group.CreateArchetypeChunkArray(Allocator.Persistent);

            rows.SetSource(chunkArray, entityManager, chunkFilter);
            setChunkArray(chunkArray);

            lastVersion = entityManager.Version;

            return(rows);
        }