How can i loop through stack and take a set number from each?
So im having an issue working out how to get my code to check through 5 stack slots in my inventory and take a a certain amount out of each stack.
I have an inventory crafting section that consist of 5 stack slots and when i drag a stack of resources into these slots crafting becomes available. however after i craft the item i want to take the set amount of resource out of the stack. this much i have worked out however if there is not enough in resource in one stack and it must move onto the next for the rest it does not work.
my code is too long to put up but more a less i have 5 slots which i use .count to get amount in all the slots. if the resources are in the slots i thin use .pop() to take the items off the stack. my problem is i cant seem to get it to take one amount from one slot and the rest from the next slot.
any suggestions would be greatly appreciated.
Your answer
Follow this Question
Related Questions
How to convert object types? 0 Answers
Why is drag and drop not working? 1 Answer
How do I get my Inventory Loading to work again? ArgumentOutOfRangeException 2 Answers
Canvas Inventory closing 0 Answers
How to add "Properties" to items? 1 Answer