Exemple #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);
    }
Exemple #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);
    }
Exemple #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());
    }
 public void FilterChanged()
 {
     OnFilterChange?.Invoke(this);
 }
Exemple #5
0
 public void SetFilter(SearchFilterType filterType)
 {
     Filter = filterType;
     OnFilterChange?.Invoke();
 }