Class TimeEffects
Convenience helpers that compose a TimeScaleModifier push with a self-cancelling auto-revert into common gameplay-feel effects: hit-stop, bullet-time windows, and instant slow-motion windows.
Inherited Members
Namespace: Scylla.Core.Time
Assembly: ScyllaCore.dll
Syntax
public static class TimeEffects
Remarks
Each helper returns a TimeEffectHandle that the caller may Cancel() early. If the caller does nothing, the effect runs for its configured duration and self-cleans-up via the modifier stack's duration-based expiration.
All helpers operate on a ScyllaClock. Callers that want the
master clock can pass ScyllaTime.Instance.MasterClock; helpers throw
ArgumentNullException when the clock is null.
Fields
BULLET_TIME_SOURCE_ID
Default source ID for bullet-time modifiers.
Declaration
public const string BULLET_TIME_SOURCE_ID = "TimeEffects.BulletTime"
Field Value
| Type | Description |
|---|---|
| string |
HIT_STOP_PRIORITY
Default priority for hit-stop modifiers - higher than bullet-time so a hit-stop during bullet-time still freezes the action briefly.
Declaration
public const int HIT_STOP_PRIORITY = 100
Field Value
| Type | Description |
|---|---|
| int |
HIT_STOP_SOURCE_ID
Default source ID for hit-stop modifiers.
Declaration
public const string HIT_STOP_SOURCE_ID = "TimeEffects.HitStop"
Field Value
| Type | Description |
|---|---|
| string |
SLOW_MOTION_PRIORITY
Default priority for bullet-time / slow-motion modifiers.
Declaration
public const int SLOW_MOTION_PRIORITY = 50
Field Value
| Type | Description |
|---|---|
| int |
SLOW_MOTION_SOURCE_ID
Default source ID for slow-motion-window modifiers.
Declaration
public const string SLOW_MOTION_SOURCE_ID = "TimeEffects.SlowMotionWindow"
Field Value
| Type | Description |
|---|---|
| string |
Methods
BulletTime(ScyllaClock, float, TimeUnit)
TimeUnit-typed convenience overload for BulletTime(ScyllaClock, float, float).
Declaration
public static TimeEffectHandle BulletTime(ScyllaClock clock, float scale, TimeUnit duration)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaClock | clock | |
| float | scale | |
| TimeUnit | duration |
Returns
| Type | Description |
|---|---|
| TimeEffectHandle |
BulletTime(ScyllaClock, float, float)
Slows clock to the supplied multiplicative scale
for realSeconds real seconds. The effect is a Multiply-mode
modifier so it stacks naturally with any other slow / fast modifiers below it
in priority.
Declaration
public static TimeEffectHandle BulletTime(ScyllaClock clock, float scale, float realSeconds)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaClock | clock | The clock to slow. Must be non-null. |
| float | scale | Multiplicative scale, e.g. 0.2 for 5x slower. Negative values reverse the clock. |
| float | realSeconds | Real-world seconds the bullet-time should last. Clamped to a minimum of 0. |
Returns
| Type | Description |
|---|---|
| TimeEffectHandle | A handle the caller may use to cancel the bullet-time early. |
CancelAllEffects(ScyllaClock)
Removes any currently-active hit-stop / bullet-time / slow-motion modifiers from
clock. Useful for cinematics or game-state changes that want to
guarantee no time effect lingers.
Declaration
public static int CancelAllEffects(ScyllaClock clock)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaClock | clock |
Returns
| Type | Description |
|---|---|
| int |
HitStop(ScyllaClock, TimeUnit)
TimeUnit-typed convenience overload for HitStop(ScyllaClock, float).
Lets callers express the freeze duration in human-readable units, e.g.
new TimeUnit { Millisecond = 80 } instead of 0.08f.
Declaration
public static TimeEffectHandle HitStop(ScyllaClock clock, TimeUnit duration)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaClock | clock | |
| TimeUnit | duration |
Returns
| Type | Description |
|---|---|
| TimeEffectHandle |
HitStop(ScyllaClock, float)
Briefly freezes clock for realSeconds.
Pushes an Override-mode modifier with scale = 0 onto the clock's stack. The
modifier auto-expires after the supplied duration via the modifier stack's own
duration timer (which counts UNSCALED real seconds, so the freeze ends correctly
even though the clock itself is at zero rate).
Declaration
public static TimeEffectHandle HitStop(ScyllaClock clock, float realSeconds)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaClock | clock | The clock to freeze. Must be non-null. |
| float | realSeconds | Real-world seconds the freeze should last. Clamped to a minimum of 0. |
Returns
| Type | Description |
|---|---|
| TimeEffectHandle | A handle the caller may use to cancel the freeze early. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
SlowMotionWindow(ScyllaClock, float, TimeUnit)
TimeUnit-typed convenience overload for SlowMotionWindow(ScyllaClock, float, float).
Declaration
public static TimeEffectHandle SlowMotionWindow(ScyllaClock clock, float scale, TimeUnit duration)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaClock | clock | |
| float | scale | |
| TimeUnit | duration |
Returns
| Type | Description |
|---|---|
| TimeEffectHandle |
SlowMotionWindow(ScyllaClock, float, float)
Identical in mechanics to BulletTime(ScyllaClock, float, float) but uses a different source ID, allowing distinct designer intent ("a slow-mo window from a power-up" vs "bullet-time triggered by hitting a target") for filtering and instrumentation.
Declaration
public static TimeEffectHandle SlowMotionWindow(ScyllaClock clock, float scale, float realSeconds)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaClock | clock | |
| float | scale | |
| float | realSeconds |
Returns
| Type | Description |
|---|---|
| TimeEffectHandle |