Connecting Components
UPFS components are deliberately modular. Upgrade SO remains the source of progression truth, while Economy, Currency, Info Provider and listeners add only the responsibilities your feature requires.
Component responsibilities
| Component | Owns | References |
|---|---|---|
| Upgrade SO | Structure, values, completion and progression events | No supporting component required |
| Currency SO | One shared numeric balance and its persistence | Independent data asset |
| Economy Handler | Costs, wallet policy, affordability and purchase transactions | Upgrade SO and Currency assets |
| Info Provider | Presentation-ready standard and custom metadata | Upgrade SO |
| Listeners | Scene-level UnityEvent routing | The asset they observe |
Minimal progression setup
Use Upgrade SO alone when gameplay controls payment or unlock conditions elsewhere.
-
01
Create Upgrade SO
Author the complete Big and Small Upgrade sequence.
-
02
Read current state
Use GetCurrentUpgrade to initialize gameplay values.
-
03
Advance
Call PerformUpgrade after your own eligibility logic succeeds.
-
04
React
Subscribe to events or add an Upgrade Listener for presentation feedback.
Progression with an economy
Add Currency and Economy Handler when UPFS should evaluate affordability and execute payment.
-
01
Create currencies
Create one stable Currency SO for every supported payment balance.
-
02
Connect source
Assign the Upgrade SO to Upgrade Economy Handler and fetch its structure.
-
03
Generate costs
Configure matching currency names, ranges and distributions.
-
04
Assign wallet
Reference the Currency assets and select a payment mode.
-
05
Purchase
Use PurchaseNextUpgrade or PurchaseWithCurrency from the runtime UI.
Presentation and UI setup
Add Info Provider when the interface needs more than level, value and price.
- Use Upgrade SO for live current and next progression state.
- Use Economy Handler for costs and affordability.
- Use Info Provider for icons, labels, colors, materials and descriptions.
- Use listener components for scene-configured refreshes and feedback.
Initialization order
-
01
Load Currency and Upgrade state
Restore authoritative player data first.
-
02
Check synchronized structures
Ensure Economy and Info Provider data reflect the current authored Upgrade structure.
-
03
Bind listeners
Enable subscriptions before the user can interact.
-
04
Render UI
Read current, next, cost and custom information into the first visible state.