Skip to content

💰 Pickups → Currency Integration

This folder provides an optional integration bridge between the Pickups system and the RevFramework Currency system.

It allows pickup effects to modify currency without introducing a hard dependency on the Currency module.

This integration is built and supported for RevFramework systems only.
It is not intended as a general integration layer for third-party currency solutions.


🧠 What This Integration Does

The GiveCurrencyEffect allows pickups to:

  • Grant currency (e.g. +10 Gold)
  • Remove currency (e.g. -5 Gold, if supported)
  • Apply changes using a soft-linked currency service

👉 This keeps the Pickups system fully decoupled from Currency.


🔧 How It Works

Currency is resolved at runtime using a best-effort approach:

Resolution Order

  1. CurrencyResolve.ServiceFrom(Transform) (via reflection)
  2. CurrencyServiceRelay (on the context hierarchy or globally)
  3. Known concrete services (e.g. CurrencyService)

Once resolved, the system attempts to call a method with signature:

(string currencyId, int amount)

Supported method names include:

  • Add
  • Adjust
  • Credit
  • Deposit

👉 The first compatible match is used.


⚠️ Important

This is optional

  • Pickups do not require Currency
  • This integration is only used if a compatible service is present

No hard dependency

  • The Pickups assembly does not reference Currency directly
  • All resolution is done via reflection or relays
  • You can remove this folder without affecting Pickups

Behaviour depends on the Currency system

  • Negative amounts are only supported if the underlying service allows them
  • Method naming must match one of the supported verbs
  • Services must expose a compatible (string, int) method

🧪 Example Usage

  1. Create a GiveCurrencyPickupDefinition
  2. Set:

  3. currencyId = "Gold"

  4. amount = 10

  5. Assign the definition to a pickup

  6. Ensure a Currency service or relay exists in the scene

👉 When the pickup is consumed, currency will be adjusted if a compatible service is found.


🧠 Design Intent

This integration demonstrates:

  • How Pickups can interact with other RevFramework systems
  • How to use soft dependencies instead of hard references
  • How to keep systems modular and optional

🌍 Third-Party / Custom System Use

This integration is built for RevFramework Currency systems only.

If you are using a different currency system:

  • Treat this as a reference example
  • Implement your own pickup effect
  • Use your own service layer

👉 Custom or third-party currency integrations are not supported by this adapter.


🧹 Safe to Remove

This folder is completely optional.

Removing it will:

  • Not affect the Pickups runtime
  • Not break existing pickup behaviour
  • Only remove currency-related functionality

🧠 Summary

This integration answers:

“How can pickups affect currency without coupling systems?”

It provides:

  • A soft-linked currency effect
  • A safe, optional extension point
  • A clear integration pattern

Use it as a reference, extend it, or replace it entirely.