public virtual void ClearSelection() { if (m_SelectedListItem != null) { m_SelectedListItem.RemoveFromClassList("selected"); m_SelectedListItem = null; OnListItemSelectedOrRemoved?.Invoke(m_SelectedListItem); DisableRightPanelContent(); } }
public void UpdateSelectedListItem <T>(T _listItem) where T : ListItem { if (m_SelectedListItem == _listItem) { return; } if (m_SelectedListItem != null) { m_SelectedListItem.RemoveFromClassList("selected"); OnListItemDeselected?.Invoke(m_SelectedListItem); } m_SelectedListItem = _listItem; m_SelectedListItem?.AddToClassList("selected"); OnListItemSelectedOrRemoved?.Invoke(m_SelectedListItem); UpdateConfigurator(); }
public void DeleteListItem <T>(T _listItem) where T : ListItem { if (_listItem == m_SelectedListItem) { bool neighbourSelected = SelectNeighbourListItem(MoveDirection.Up); if (!neighbourSelected) { neighbourSelected |= SelectNeighbourListItem(MoveDirection.Down); } if (!neighbourSelected) { m_SelectedListItem = null; OnListItemSelectedOrRemoved?.Invoke(m_SelectedListItem); DisableRightPanelContent(); } } _listItem.RemoveFromHierarchy(); m_ListItems.Remove(_listItem); AddUnsavedMarker(); OnListItemDeleted?.Invoke(_listItem); }