Magic Time Integration

v1.0

The Magic Time bridge is a built-in adapter that lets Juicy Actions (actions, executors) respect local time scaling by hooking into the Magic Time module. If your game already uses Magic Time (or wants to), the bridge ensures that all actions operate under that local-time clock, rather than the Juicy Action timescale.

Quick Start: Integrate Magic Time

1. Extract Magic Time Integration & Import Magic Time

Import Magic Time from Package Manager. Then, extract the bridge file in MagicTimeIntegration.unitypackage.

2. Add MagicTimeUser or IUseLocalTime

Any GameObject (or component) that should influence time-based actions must have a component implementing IUseLocalTime. The simplest is the provided MagicTimeUser (or a subclass), or you can roll your own class that implements IUseLocalTime.

The most basic format is to add the MagicTimeUser component to your object. Then, assign the Magic Time timescales that you want to affect this object. The ActionExecutor will find this component, and utilize its timescale values.

3. Press Play

  1. Press Play — the bridge registers automatically, and all Actions will now follow your local Magic Time scale.

Detailed Description of Operations

MagicTimeClockResolver is the bridge class that is used to connect Magic Time with Juicy Actions. The bridge implements IClockResolver.

When loaded, it registers itself automatically:

[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
private static void Install() => ActionClock.Register(new MagicTimeClockResolver());

Then, whenever an ActionExecutor requests a clock:

  1. The executor calls all registered resolvers in priority order.

  2. MagicTimeClockResolver looks for IHaveLocalTime on the target or its parents.

  3. If found, it wraps that component inside a MagicTimeObjectClock, which adapts Magic Time’s interface to Juicy Actions IClock.

  4. The executor uses that clock for all delta- and wait-based operations.

Custom Time Bridge / Integrations

Last updated

Was this helpful?