void UpdateComponentOrder(EntityInspectorComponentOrder current)
        {
            m_CurrentComponentOrder.Reset();
            using (var pooledElements = PooledList <ComponentElementBase> .Make())
            {
                ComputeCurrentComponentOrder(m_CurrentComponentOrder, pooledElements);

                if (current == m_CurrentComponentOrder)
                {
                    return;
                }

                // Component removed since the last update
                using (var pooled = ComputeRemovedComponents(current.Components, m_CurrentComponentOrder.Components))
                {
                    var list = pooled.List;
                    foreach (var path in list)
                    {
                        var element = pooledElements.List.Find(ce => ce.Path == path);
                        element?.RemoveFromHierarchy();
                    }
                }

                // Tags removed since the last update
                using (var pooled = ComputeRemovedComponents(current.Tags, m_CurrentComponentOrder.Tags))
                {
                    var list = pooled.List;
                    foreach (var path in list)
                    {
                        var element = pooledElements.List.Find(ce => ce.Path == path);
                        element?.RemoveFromHierarchy();
                    }
                }

                // Component added since the last update
                using (var pooled = ComputeAddedComponents(current.Components, m_CurrentComponentOrder.Components))
                {
                    var list      = pooled.List;
                    var container = Target.Container;
                    foreach (var path in list)
                    {
                        PropertyContainer.Visit(ref container, m_InspectorVisitor, new PropertyPath(path));
                    }
                }

                // Tags removed since the last update
                using (var pooled = ComputeAddedComponents(current.Tags, m_CurrentComponentOrder.Tags))
                {
                    var list      = pooled.List;
                    var container = Target.Container;
                    foreach (var path in list)
                    {
                        PropertyContainer.Visit(ref container, m_InspectorVisitor, new PropertyPath(path));
                    }
                }
            }
        }
 void ComputeCurrentComponentOrder(EntityInspectorComponentOrder info, List <ComponentElementBase> elements)
 {
     elements.Clear();
     m_ComponentsRoot.Query <ComponentElementBase>().ToList(elements);
     foreach (var ce in elements)
     {
         if (ce.Type == ComponentPropertyType.Tag)
         {
             info.Tags.Add(ce.Path);
         }
         else
         {
             info.Components.Add(ce.Path);
         }
     }
 }
 public EntityInspectorStructureVisitor()
 {
     ComponentOrder = new EntityInspectorComponentOrder();
 }
 public bool Equals(EntityInspectorComponentOrder other)
 {
     return(this == other);
 }