Crafting¶
Crafting is handled by CraftingSystem, CraftRecipeData, and the crafting UI scripts.
Main Scripts¶
Assets/PixitGames/BlockWorld/Scripts/CraftingSystem.cs
Assets/PixitGames/BlockWorld/Scripts/CraftRecipeData.cs
Assets/PixitGames/BlockWorld/Scripts/UI/CraftingGridUI.cs
Assets/PixitGames/BlockWorld/Scripts/UI/CraftingGridSlotUI.cs
Assets/PixitGames/BlockWorld/Scripts/UI/CraftingResultSlotUI.cs
Recipe Data¶
Recipes support:
- Grid size
- Shaped or shapeless matching
- Block, tool, or item inputs
- Output block, tool, or item
- Output amount
- Optional crafting station requirement
Crafting Stations¶
Set this on a block:
BlockData.isCraftingStation = true
When the player right-clicks that block, BlockInteractor opens the crafting station UI through InventoryUI.OpenCraftingStation().
Basic Workflow¶
- Create or select a
CraftRecipeData. - Configure grid size and shaped/shapeless mode.
- Assign inputs.
- Assign output.
- Add the recipe to the crafting system recipe list.
- Test in the inventory or crafting station UI.
Generated Recipes¶
Block and item creator tools can generate recipe assets automatically when recipe creation is enabled.
Generated recipe examples live under:
Assets/PixitGames/BlockWorld/GeneratedBlocks
Assets/PixitGames/BlockWorld/GeneratedItems