diff --git a/src/UI/ExplorerFilterTagsSelector.cs b/src/UI/ExplorerFilterTagsSelector.cs index bd85f8d0..8c831c7a 100644 --- a/src/UI/ExplorerFilterTagsSelector.cs +++ b/src/UI/ExplorerFilterTagsSelector.cs @@ -166,20 +166,15 @@ public void ToggleTagInExplorerFilter(TagContainerItem tagItem) if(this.m_view != null && !this.m_isUpdating) { string tagName = tagItem.tagName.text; - bool isSelected = false; + StateToggleDisplay toggleComponent = tagItem.GetComponentInChildren(true); - for(int i = 0; i < this.m_selectedTags.Length && !isSelected; ++i) + if(toggleComponent.isOn) { - isSelected = (this.m_selectedTags[i] == tagName); - } - - if(isSelected) - { - this.m_view.RemoveTagFromFilter(tagName); + this.m_view.AddTagToFilter(tagName); } else { - this.m_view.AddTagToFilter(tagName); + this.m_view.RemoveTagFromFilter(tagName); } } }