Custom Time Bridge / Integrations

v1.0

If your game has its own time system (e.g. a game β€œtime manager” with variable clocks), you can integrate it with Juicy Actions by making your own bridge / resolver, similar to the Magic Time Integration.

1. Create a Clock Resolver

A resolver simply tells Juicy Actions:

"If this GameObject users my time system, give it my clock instead of the Juicy Action clock."

Here's an example. Here you'd replace IMyTimeProvider with your own interface or component.

2. Wrap Your Time System in an IClock Adapter

You can call this something other than MyTimeObjectClock if you'd prefer, and use the same interface as you did in step 1.

This pattern is exactly what MagicTimeClockResolver and MagicTimeObjectClock do internally β€” it’s just type-safe and localized to your own interfaces.

Interface Expectations

Your custom time provider (the thing your game already uses) only needs to expose the same shape of data expected by the adapter:

If your system already has different names (e.g., GameTime, DeltaGameTime), you can simply map them in your MyTimeObjectClock.

Full Sample Code

This is a full code sample that you may wish to refer to, or pass into your favorite AI to help you create your bridge.

Last updated

Was this helpful?