protected virtual void ElementSelectionChanged(List <VisualElement> elements) { if (m_SelectionMadeExternally) { return; } if (elements == null) { m_Selection.ClearSelection(this); return; } m_Selection.ClearSelection(this); foreach (var element in elements) { if (element.ClassListContains(BuilderConstants.ExplorerItemUnselectableClassName)) { m_SelectionMadeExternally = true; m_ElementHierarchyView.ClearSelection(); m_SelectionMadeExternally = false; m_Selection.ClearSelection(this); return; } m_Selection.AddToSelection(this, element); } }
void ElementSelected(VisualElement element) { if (m_SelectionMadeExternally) { return; } if (element == null) { m_Selection.ClearSelection(this); return; } else if (element.ClassListContains(BuilderConstants.ExplorerItemUnselectableClassName)) { m_SelectionMadeExternally = true; m_ElementHierarchyView.ClearSelection(); m_SelectionMadeExternally = false; m_Selection.ClearSelection(this); return; } m_Selection.Select(this, element); }