Juicy Actions Clock
v1.0
You don't need to add or configure anything in your scene. The clock is created automatically the first time Juicy Actions or classes which call it needs it.
Juicy Actions includes an internal Clock System called the Juicy Actions Clock (JuicyActionsClock). This clock is a lightweight, global timing layer that all Juicy Actions β and all ActionExecutor instances β automatically use.
By default, the Juicy Actions Clock mirrors Unity's built-in Time values, but it can also:
apply pausing and local time scaling
be replaced by your own custom time source (such as Magic Time or another clock system)
provide consistent, deterministic time values for all Juicy Actions, regardless of scene setup
Key Features
Singleton access
Use JuicyActionsClock.Instance from anywhere.
Implements IClock
Works seamlessly with ActionExecutor, actions, and resolvers.
No scene setup required
Lazy-loaded on first use.
Pause and Resume control
Temporarily stop all delta-based actions without stopping Unity's time.
Local time scaling
Multiply or reduce perceived time progression for all actions.
Custom provider support
Replace the default Unity time provider with your own system (e.g. Magic Time).
How It Works
All Juicy Actions fetch their time and delta values through an interface called IClock.
Singleton access from any script:
When you run any action:
The executor does not read from UnityEngine.Time.deltaTime directly. Instead, it reads from JuicyActionsClock.Instance, which internally wraps a time provider. This provider can be:
the default Unity clock (
Time.time,Time.deltaTime), ora custom provider that you install (e.g. Magic Time, custom physics clock, etc.)
What the Clock Returns
Time
The current time (seconds since startup).
UnityEngine.Time.time
UnscaledTime
Time ignoring Unity's Time.timeScale.
UnityEngine.Time.unscaledTime
DeltaTime
Time elapsed since the last frame. Affected by pause and local scale.
Time.deltaTime
UnscaledDeltaTime
Delta time ignoring all scaling or pausing.
Time.unscaledDeltaTime
TimeScale
Local multiplier applied to delta time (independent of Unity's).
1.0f
IsPaused
Whether the overlay pause layer is currently active.
false
By default, all of these values exactly mirror Unity's Time values. Modify them only if you want local control (for example, pausing an ActionExecutor while gameplay continues).
Some Actions will modify the timescale as well, automatically.
Modifying the Clock
Pause / Resume
Pause or resume all Juicy Actions globally:
When paused:
IsPausedbecomestrue.DeltaTimereturns0.Actions that depend on time progression (e.g. Move, Wait, Fade) will freeze in place until resumed.
Time Scaling
Adjust the clock's local time scale to slow down or speed up the action system:
This multiplies the clock's DeltaTime, allowing slow-motion or fast-forward effects independent of Unity's Time.timeScale.
Custom Clock Providers
Replace the base time source with your own implementation. Useful if your game has its own time system or uses a local time controller like Magic Time.
Last updated
Was this helpful?