示例#1
0
    public void FilterSmartItem()
    {
        filterObjects.Clear();
        foreach (CatalogItem catalogItem in DataStore.i.dataStoreBuilderInWorld.catalogItemDict.GetValues())
        {
            if (!catalogItem.IsSmartItem())
            {
                continue;
            }

            bool foundCategory = false;
            foreach (Dictionary <string, List <CatalogItem> > groupedSceneObjects in filterObjects)
            {
                if (groupedSceneObjects.ContainsKey(catalogItem.category))
                {
                    foundCategory = true;
                    if (!groupedSceneObjects[catalogItem.category].Contains(catalogItem))
                    {
                        groupedSceneObjects[catalogItem.category].Add(catalogItem);
                    }
                }
            }
            if (!foundCategory)
            {
                AddNewSceneObjectCategoryToFilter(catalogItem);
            }
        }

        OnFilterChange?.Invoke(filterObjects);
    }
示例#2
0
    public void OnSearchInputChanged(string currentSearchInput)
    {
        if (string.IsNullOrEmpty(currentSearchInput))
        {
            OnFilterRemove?.Invoke();
            return;
        }

        if (currentSearchInput.Length <= 1)
        {
            return;
        }
        isFilterActive = true;
        FilterAssets(currentSearchInput);
        OnFilterChange?.Invoke(filterObjects);
    }
示例#3
0
    public void OnSearchInputChanged(string currentSearchInput)
    {
        if (string.IsNullOrEmpty(currentSearchInput))
        {
            OnFilterRemove?.Invoke();
            return;
        }

        if (currentSearchInput.Length <= 1)
        {
            return;
        }
        currentSearchFilter = currentSearchInput;

        isFilterActive = true;

        FilterAssets(currentSearchInput);
        OnFilterChange?.Invoke(filterObjects);
        if (searchApplyCoroutine != null)
        {
            CoroutineStarter.Stop(searchApplyCoroutine);
        }
        searchApplyCoroutine = CoroutineStarter.Start(ReportSearchAnalytic());
    }
示例#4
0
 public void FilterChanged()
 {
     OnFilterChange?.Invoke(this);
 }
示例#5
0
 public void SetFilter(SearchFilterType filterType)
 {
     Filter = filterType;
     OnFilterChange?.Invoke();
 }