SS3D
SS3D copied to clipboard
Stacking items
Summary
Add the ability to stack items in containers. each type of stackable item has its own limit, regarding how much can fit inside a single container slot.
Stacked items should have a container as well, and it should be possible to add/remove items from the bundle with an interaction.
Add the necessary check for containers to add items to a specific slot. If an item is dropped on another item of the same kind, when taking the items out of inventory, it should display as multiple items.
UI should probably display the number of items in that slot too.
Bundles should be stackable with bundles, and when dropping a bundle on another, the expected behavior is that the bundle fills up until it reach its maximum, and the rest, if there's any, goes back to the slot where it was initially.
Regarding how it should look, @cosmiccoincidence says "Just build the prefab of a stackable object to have hidden copies of the 3d object that can be enabled as the bundle increases."
This should be implemented as a separate component for items, that handle number of items that can be stacked, as well as the visual display.
Item could have a IsStackable property that just check if component Stackable is on the same game object as item.