public void Add(Mod mod, ProductDetails product, ShopType shopType, Action <PurchaseInfo> action, GameObject go) { ShopItems item = new ShopItems { mod = mod, details = product, action = action, gameObject = go }; if (shopType == ShopType.Teimo) { teimoShopItems.Add(item); } else { fleetariShopItems.Add(item); } }
public void AddToCart(ShopItems item) { if (shoppingCart.ContainsKey(item)) { if (item.details.multiplePurchases) { shoppingCart[item] += 1; } else { ModUI.ShowMessage("This item can be bought only once", "Information"); } } else if (item.purchashed) { ModUI.ShowMessage("You already bought this item", "Information"); } else { shoppingCart.Add(item, 1); } UpdateCart(); }