Example #1
0
        VisualElement MakeItem()
        {
            var systemItem = SystemSchedulePool.GetSystemInformationVisualElement(this);

            systemItem.World = m_World;
            return(systemItem);
        }
Example #2
0
        /// <summary>
        /// Refresh tree view to update with latest information.
        /// </summary>
        void Refresh()
        {
            // This is needed because `ListView.Refresh` will re-create all the elements.
            SystemSchedulePool.ReturnAllToPool(this);
            SystemTreeView.Refresh();

            // System details need to be updated also.
            m_SystemDetailsVisualElement.Target       = m_LastSelectedItem;
            m_SystemDetailsVisualElement.SearchFilter = SearchFilter;
        }
Example #3
0
        public void Refresh(World world)
        {
            if ((m_World != world) && (this.Contains(m_SystemDetailsVisualElement)))
            {
                this.Remove(m_SystemDetailsVisualElement);
            }

            m_World = world;

            foreach (var root in m_TreeRootItems.OfType <SystemTreeViewItem>())
            {
                root.ReturnToPool();
            }
            m_TreeRootItems.Clear();

            if (World.All.Count > 0)
            {
                var graph = PlayerLoopSystemGraph.Current;

                if (!string.IsNullOrEmpty(SearchFilter) && SearchFilter.Contains(Constants.SystemSchedule.k_SystemDependencyToken))
                {
                    SystemScheduleUtilities.GetSystemDepListFromSystemTypes(GetSystemTypesFromNamesInSearchFilter(graph), m_SystemDependencyList);
                    if (null == m_SystemDependencyList || !m_SystemDependencyList.Any())
                    {
                        if (this.Contains(m_SystemDetailsVisualElement))
                        {
                            Remove(m_SystemDetailsVisualElement);
                        }
                    }
                }

                foreach (var node in graph.Roots)
                {
                    if (!node.ShowForWorld(m_World))
                    {
                        continue;
                    }

                    var item = SystemSchedulePool.GetSystemTreeViewItem(graph, node, null, m_World);

                    PopulateAllChildren(item);
                    m_TreeRootItems.Add(item);
                }
            }

            Refresh();
        }