Exemple #1
0
    void SetCategoryList()
    {
        //Reset category, item infos
        categoryInfos.Clear();
        itemInfos.Clear();
        int categoryCount = categoryList.Count;

        if (categoryCount > 0)
        {
            for (int categoryIndex = 0; categoryIndex < categoryCount; categoryIndex++)
            {
                //Set Category info
                CategoryInfos info = new CategoryInfos();
                info.categoryId   = categoryIndex;
                info.categoryName = categoryList[categoryIndex];
                categoryInfos.Add(info);

                //save items for each category
                SetItemDetails(itemCountList[categoryIndex], categoryIndex);
            }

            //Create Categories
            categoryPanel.CreateCategories(categoryInfos);
            //Create items
            GenerateItems();
        }
    }
Exemple #2
0
    public CategoryInfo GetCategoryInfo(string category_name)
    {
        CategoryInfo category_info;

        if (CategoryInfos.TryGetValue(category_name, out category_info) == false)
        {
            throw new System.Exception(string.Format("GetCategoryInfo Error : {0}", category_name));
        }
        return(category_info);
    }
    //Generate category
    public void CreateCategories(List <CategoryInfos> infos)
    {
        //Reset values
        category.SetStatusTo(true);
        ClearAllSlides();

        Transform parent = category.GetParent();

        for (int gridIndex = 0; gridIndex < infos.Count; gridIndex++)
        {
            CategoryInfos info        = infos[gridIndex];
            CategoryInfo  newCategory = null;
            newCategory = Instantiate(category, parent) as CategoryInfo;

            //Set properties to category
            if (newCategory != null)
            {
                newCategory.SetStatusTo(true);

                int index = info.categoryId;
                newCategory.name = info.categoryName;
                newCategory.SetBasicInfo(index, info.categoryName);
                newCategory.SetCategorySeletionStatus(true, normalColor);
                newCategory.GetCategoryBtn();

                allCategories.Add(newCategory);
            }
        }

        //Save all category info
        categoryInfo = infos;
        //Disable sample category
        category.SetStatusTo(false);
        //Set clear button in-active
        clearBtn.interactable = false;
    }
Exemple #4
0
 public void ApplyScale()
 {
     SummaryInfo.Scale = Scale;
     CategoryInfos.ForEach(x => x.Scale = Scale);
 }