Skip to content

Crafting — Samples / Scripts

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

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


📌 What this folder is for

The scripts here show how to wire Crafting into a game, including:

  • Listening to Crafting events (jobs, XP, failure reasons)
  • Implementing adapters (inventory, currency) in a minimal way
  • Writing custom validators/modifiers
  • Persisting or restoring state in demo-friendly ways
  • Building quick debug or demo UIs

They are intentionally: - Simple - Incomplete - Easy to replace or delete


⚠️ Important boundaries

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

In particular:

  • They may use PlayerPrefs, Editor-only APIs, or reflection
  • They may skip edge cases, persistence guarantees, or performance concerns
  • They may change or be removed without notice

If you want this behaviour in your game, reimplement it in your own runtime code.


🧪 Samples vs Teachables

It’s important to distinguish between two concepts:

Teachables

  • Live under Teaching/
  • Act as hostile consumers
  • Use only documented public APIs
  • Avoid reflection and Editor-only access
  • Teach the guaranteed behaviour of the system

Samples (this folder)

  • Live under Samples/
  • Demonstrate patterns and ideas
  • May use reflection or Editor-only helpers
  • Are scaffolding, not contracts

If you’re unsure which one to copy from, prefer Teachables for API usage and Samples for inspiration only.


📁 Contents (examples)

You may find scripts here such as:

  • CooldownPersistenceSample — demo persistence of cooldowns using wall clock
  • FakeInventoryAdapter / FakeCurrencyAdapter — minimal in-memory adapters
  • Sample validators or HUD controllers — wiring examples only
  • Debug or demo panels — quick UI scaffolding

None of these are required to use Crafting.


🧠 How to use these safely

  • Read them to understand integration flow
  • Copy ideas, not implementations
  • Delete them once you’ve built your own systems
  • Do not ship them as-is

TL;DR

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