I have implemented a modular building system in my game. When a player places a new building part, I want the cost drawn from the player's inventory by crafting a new building part and then placing it.
To achieve this my thoughts are this:
1) When checking the placing conditions of the building part, I also check to see the player has the items needed in their inventory
var canCraft = myCrafter.Processor.CanCraft(craftingRecipe, inventory, amount);
My issue is that I'm unsure how to set the craftingRecipe before calling the method.
2) When the player places the building part actually craft it.
I have been looking through the Crafting Menu script, but sadly my coding skills are not good enough to understand how it works.
any help would be greatly appreciated
To achieve this my thoughts are this:
1) When checking the placing conditions of the building part, I also check to see the player has the items needed in their inventory
var canCraft = myCrafter.Processor.CanCraft(craftingRecipe, inventory, amount);
My issue is that I'm unsure how to set the craftingRecipe before calling the method.
2) When the player places the building part actually craft it.
I have been looking through the Crafting Menu script, but sadly my coding skills are not good enough to understand how it works.
any help would be greatly appreciated