Exemple #1
0
        private void RefreshVisualStates()
        {
            var changedVisualStates = new List <VisualState>();

            foreach (var state in m_VisualStateList)
            {
                var package = m_PackageDatabase.GetPackage(state.packageUniqueId);
                var visible = m_PackageFiltering.FilterByCurrentSearchText(package);
                if (state.visible != visible)
                {
                    state.visible = visible;
                    changedVisualStates.Add(state);
                }
            }

            if (changedVisualStates.Any())
            {
                TriggerOnVisualStateChange(changedVisualStates);
            }
        }
        private void RefreshVisualStates()
        {
            var changedVisualStates = new List <VisualState>();

            foreach (var state in m_VisualStateList ?? Enumerable.Empty <VisualState>())
            {
                var package = m_PackageDatabase.GetPackage(state.packageUniqueId);
                if (package != null)
                {
                    var visible = tab == PackageFilterTab.AssetStore ? true : m_PackageFiltering.FilterByCurrentSearchText(package);
                    if (state.visible != visible)
                    {
                        state.visible = visible;
                        changedVisualStates.Add(state);
                    }
                }
            }

            if (changedVisualStates.Any())
            {
                TriggerOnVisualStateChange(changedVisualStates);
            }
        }