Skip to content

Teaching Support Utilities

This folder contains teachables-only helper classes used by the Crafting teaching panels.

These types exist to support panel behaviour such as:

  • short-lived UI feedback helpers
  • demo-only routing helpers
  • small panel support utilities
  • teaching-specific glue code that should not live in runtime systems

Important

Types in this folder are not part of the Crafting public API.

They are:

  • not intended for production use
  • not required by runtime systems
  • not supported as extension points
  • not covered by API stability guarantees

They may change, move, or be removed without notice.


Why This Folder Exists

Teaching panels sometimes need small helper utilities to keep examples readable, focused, and self-contained.

These helpers live here so that:

  • runtime code stays clean
  • public APIs stay intentional
  • teaching panels stay readable
  • demo-only behaviour does not leak into supported runtime systems

What Lives Here

Typical examples include:

  • event-to-UI helpers used to turn service events into short-lived panel feedback
  • demo-only output routers used by teaching panels to exercise routing seams
  • small teaching utilities that support panel UX without expanding the runtime API surface

These helpers may be used by both HostileConsumers and Demos, but they remain teachables-only code.


⚠️ Config vs Live State (Important Behaviour)

Some teachable helpers (such as TeachingOutputRouter) support optional ScriptableObject configs for convenience.

When enabled, these configs are copied into the component’s live state during:

  • Awake
  • OnEnable
  • OnValidate (editor)

This means:

  • The component remains the runtime source of truth
  • The config is only used to seed or reset that state

What this means in practice

If a component has:

  • a config assigned
  • applyConfigOnEnable = true

then:

  • any manual changes made directly in the inspector
  • may be overwritten automatically when the component reinitializes
  • Use configs to:
  • quickly set up demo scenarios
  • swap routing presets in scenes
  • keep test setups reusable

  • Use the component fields to:

  • tweak behaviour live during play mode
  • experiment during teaching or debugging

If you want to modify values manually without them being reset:

→ disable applyConfigOnEnable


This behaviour is intentional to keep:

  • panels
  • previews
  • service routing

all reading from the same live component state.


Relationship to Other Teaching Folders

```text Teaching └── Crafting ├── HostileConsumers │ → Panels that verify and demonstrate the supported public API surface │ ├── Demos │ → Sandbox panels demonstrating optional seams, teaching setups, or demo-only helpers │ └── Support → Teachables-only helper utilities used by panels