Magic Time - Local Time Scale
v1.0
This is an integration with Magic Time - Local Time Scale, from your favorite Magical Pig!
Integrating Magic Time will make the Juicy Action time system utilize Magic Time instead, so objects using Juicy Actions will be affected by local time scales driven through Magic Time.
Installation
Install Magic Time from Package Manager. You can deselect the "Demo" folder on import, if you'd like — we will not be using it.
Find the "MagicTimeIntegration" .unitypackage in Juicy Actions/Integrations. Extract that into your project.

MagicTimeClockResolver
The MagicTimeClockResolver automatically bridges Juicy Actions with Magic Time by allowing actions to run on an object’s local time instead of Unity’s global Time. When Juicy Actions attempts to resolve a clock for an ActionExecutor, the resolver checks the target (and its parents) for a Magic Time component that implements IHaveLocalTime.
If a Magic Time user is found, the resolver wraps it in a lightweight adapter (MagicTimeObjectClock) that implements Juicy Actions’ IClock interface. From that point on, all action timing—delays, durations, easing, and sequencing—uses the object’s local time scale, pause state, and delta time. If no Magic Time component is present, Juicy Actions falls back to its normal clock behavior automatically.
The resolver registers itself at runtime and requires no manual setup. Simply add Magic Time to an object, and any Juicy Actions targeting that object will transparently respect its local time. This keeps the integration fully optional, non-invasive, and modular—Juicy Actions does not depend on Magic Time, and projects without Magic Time behave exactly as before.
What does that mean?
It means that each object that you want to utilize Magic Time should have an IHaveLocalTime component on it, such as MagicUser or a class that derives from MagicUser.
Any ActionExecutor that is set to use "Action Time" will default to the Juicy Actions clock if there is no IHaveLocalTime component on it.
As an example, the Magic Time Integration Demo Scene has the Camera object, which has a bare MagicTimeUser component attached, with the "Global Timescale" set as the initial time scale.


Last updated