Skip to content

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

  1. Create or select a CraftRecipeData.
  2. Configure grid size and shaped/shapeless mode.
  3. Assign inputs.
  4. Assign output.
  5. Add the recipe to the crafting system recipe list.
  6. 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