🧩 Economy — Authoring (EconomyUiSpecs)¶
🎯 Purpose¶
EconomyUiSpecs provides inspector-friendly, serializable data structures used to author Economy inputs in demos, teaching panels, and lightweight tooling.
It exists to bridge the gap between:
- Unity inspector data
- Runtime Economy value types
This allows developers to quickly construct valid Economy inputs without writing code.
🧠 What It Does¶
EconomyUiSpecs defines simple structs that map cleanly to runtime types:
| Spec Type | Converts To | Purpose |
|---|---|---|
ChargeLineSpec |
ChargeLine |
Currency inputs |
ItemLineSpec |
ItemLine |
Inventory item inputs |
PriceBundleSpec |
PriceBundle |
Combined money + item bundles |
Each spec includes validation and conversion logic.
💡 Example Usage¶
var bundle = myPriceBundleSpec.ToBundle();
var result = _shop.Buy(player, _ledger, store, in bundle, deliver, vendorId, requestId);
Specs are typically populated via the inspector.
🧰 Where It Is Used¶
- Teaching panels
- Sample scenes and overlays
- Debug/testing utilities
These specs are not required for runtime usage.
⚠️ Important Notes¶
- This is authoring support only, not a runtime system
- Specs are intentionally simple and permissive
- Invalid entries are ignored during conversion
- Runtime behaviour is always defined by Economy services, not these specs
🧠 Design Intent¶
EconomyUiSpecs lives under the Economy system because:
- It depends on Economy value types (
PriceBundle,ItemLine,ChargeLine) - It is not a generic utility suitable for Common
- It should remain available even if Samples are removed
🚫 Not a Production System¶
These types are not intended for production data pipelines.
Do not:
- Use as your main economy data model
- Treat as a persistent schema
- Rely on them for validation or business logic
Instead:
- Build your own data layer
- Convert into Economy types at integration boundaries
🧠 Quick Summary¶
| Attribute | Summary |
|---|---|
| Type | Authoring support |
| Used By | Samples, Teaching, Debug tools |
| Required | ❌ No |
| Runtime Dependency | Economy only |
TL;DR¶
EconomyUiSpecsis a simple, inspector-friendly way to build valid Economy inputs for demos and teaching. It is not part of the ru