示例#1
0
 public void RemoveCatalog(BaseCatalog catalog)
 {
     if (catalogs.Contains(catalog))
     {
         catalogs.Remove(catalog);
     }
 }
示例#2
0
        public void AddNewCatalog(BaseCatalog nCatalog)
        {
            if (catalogs.Contains(nCatalog))
            {
                Debug.LogError("El objeto ya existe");
            }
            else
            {
                catalogs.Add(nCatalog);
            }

            if (!CatalogsByKey.ContainsKey(nCatalog.name))
            {
                CatalogsByKey.Add(nCatalog.name, nCatalog);
            }
        }
示例#3
0
        public Dictionary <string, List <BaseProduct> > GetItemsPerClassFromCatalog(BaseCatalog catalog)
        {
            RemoveNullEmpty(catalogs);
            catalogs.Sort(ScriptableObjectComparer);
            Dictionary <string, List <BaseProduct> > products = new Dictionary <string, List <BaseProduct> >();

            foreach (BaseProduct baseProduct in catalog.Products)
            {
                string key = baseProduct.Item.GetType().FullName;
                if (!products.ContainsKey(key))
                {
                    products.Add(key, new List <BaseProduct>());
                }
                products[key].Add(baseProduct);
            }
            return(products);
        }