hippogamesunity / HeroEditor4DHub

10 stars 0 forks source link

Reset/Reload shop #17

Open LeMutique opened 4 years ago

LeMutique commented 4 years ago

So, I have a shop of 8 slots that is using ScrollInventory script for Items. Items Parameters are added in ShopItems in ItemCollection. Then Shop is initialized in InventoryBase with the ref of ItemCollection.ShopItems. I have a button that refresh the whole shop, so it delete the 8 items and 8 new ones. ShopItems list is cleared and then the 8 new items are added, then I try Shop.Initialize(ref shop) again. Issue is that items aren't added to the dictionary, so when the Refresh Method of ScrollInventory is ran, items.Params.Type isn't foud as in Item script the id isn't referenced in the Dictionary. Could not be able to find a way to add those new items in the Dictionary. Even for like only one item, what would be the workaround to replace an item by a new one?

Thank you!