void PopulateAllChildren(SystemTreeViewItem item)
        {
            if (item.SystemHandle != null)
            {
                var systemForSearch = new SystemForSearch(item.SystemHandle)
                {
                    Node = item.Node
                };
                m_AllSystemsForSearch.Add(systemForSearch);

                var keyString = Properties.Editor.TypeUtility.GetTypeDisplayName(item.SystemHandle.GetSystemType()).Replace(".", "|");

                // TODO: Find better solution to be able to uniquely identify each system.
                // At the moment, we are using system name to identify each system, which is not reliable
                // because there can be multiple systems with the same name in a world. This is only a
                // temporary solution to avoid the error of adding the same key into the map. We need to
                // find a proper solution to be able to uniquely identify each system.
                if (!m_SystemDependencyMap.ContainsKey(keyString))
                {
                    m_SystemDependencyMap.Add(keyString, SystemDependencyUtilities.GetDependencySystemNamesFromGivenSystemType(item.SystemHandle.GetSystemType()).ToArray());
                }
            }

            // Get last selected item.
            if (item.id == m_LastSelectedItemId)
            {
                m_LastSelectedItem?.Release();
                m_LastSelectedItem = SystemTreeViewItem.Acquire(item.Graph, item.Node, (SystemTreeViewItem)item.parent, item.World);
                m_SystemDetailsVisualElement.LastSelectedItem = m_LastSelectedItem;
            }

            if (!item.HasChildren)
            {
                return;
            }

            item.PopulateChildren();

            foreach (var child in item.children)
            {
                PopulateAllChildren(child as SystemTreeViewItem);
            }
        }
Ejemplo n.º 2
0
        void PopulateAllChildren(SystemTreeViewItem item)
        {
            if (item.id == m_LastSelectedItemId)
            {
                m_LastSelectedItem = item;
                m_SystemDetailsVisualElement.LastSelectedItem = m_LastSelectedItem;
            }

            if (!item.HasChildren)
            {
                return;
            }

            item.PopulateChildren(SearchFilter, m_SystemDependencyList);

            foreach (var child in item.children)
            {
                PopulateAllChildren(child as SystemTreeViewItem);
            }
        }