Skip to content

Crafting — Samples / Scripts

This folder contains sample-only scripts used by Crafting demo scenes.

These files exist to demonstrate integration patterns and usage examples, not to provide production-ready systems or supported APIs.


Purpose

The scripts here show how Crafting can be integrated into a game, including:

  • Subscribing to Crafting events (jobs, XP, failure reasons)
  • Implementing adapters (inventory, currency) in a minimal way
  • Writing simple custom validators or demo providers
  • Building debug/demo UI and sandbox helpers

They are intentionally:

  • simple
  • incomplete
  • easy to replace or delete

Structure

This folder is organised by type of sample, grouped under a single DemoHelpers layer:

  • DemoHelpers/
    Sample-only scaffolding used to support demo scenes

  • Adapters/
    Fake/sample implementations of inventory and currency adapters

  • Authoring/
    Sample ScriptableObject wrappers used to define data in demo scenes
    (e.g. standalone recipe authoring without integrations)

  • Runtime/
    Sample runtime registration and glue code that connects authoring helpers
    to the supported public API (e.g. recipe resolution via RecipeResolve)

  • DemoHooks/
    Scene wiring, quick helpers, and minimal integration examples

Each subfolder may contain its own README where behaviour needs additional explanation.


Important boundaries

These scripts are not part of the supported Crafting public API.

They may be:

  • simplified
  • demo-oriented
  • incomplete by design

They may also:

  • rely on fake/sample backends
  • expose helper methods that are not part of the real adapter interfaces
  • skip edge cases, validation, persistence, or production UX concerns

If you need similar behaviour in your game:

👉 Reimplement it in your own runtime code
👉 Use the public API as documented, not these sample classes


Samples vs Teachables

It’s important to distinguish between:

Teachables

  • Located under Teaching/
  • Act as hostile consumers
  • Use only documented public APIs
  • Avoid reflection and editor-only access
  • Represent supported behaviour

Samples (this folder)

  • Located under Samples/
  • Show patterns, scaffolding, and demo setups
  • May use fake/sample implementations
  • Are not contracts

👉 If you’re copying code: - Use Teachables for correct API usage
- Use Samples for inspiration, wiring ideas, and sandbox patterns only


How to use these safely

  • Read them to understand integration flow
  • Copy ideas, not implementations
  • Replace them with your own systems
  • Do not ship them as-is unless you fully own the consequences

TL;DR

These scripts are learning scaffolding, not framework features.
Useful to read, safe to delete, unsupported by design.