Interface IClockSource
The minimal contract every clock-like time source satisfies. Decouples scheduler,
scaled-timer, and effect code from the concrete ScyllaTime or
ScyllaClock types.
Namespace: Scylla.Core.Time
Assembly: ScyllaCore.dll
Syntax
public interface IClockSource
Remarks
Implementations include the global ScyllaTime singleton (which represents the master pause/time-scale state shared across the application) and each per-clock instance once the multi-clock layer is added in a later phase. A given consumer (timer, scheduler, smooth-transition driver) depends on this interface rather than a concrete type so it can be retargeted between the global service and an isolated clock without code changes.
Properties are read-only by design. State mutation is the responsibility of the clock implementation (for example, SetTimeScale(float)).
Per-clock "own pause" state (the clock's IsPausedOwn-style flag, ignoring any
parent source's pause) is intentionally absent from this interface. The interface
describes a clock as observed by downstream consumers; whether the pause originated
on this clock or was inherited from its parent is a per-clock implementation
detail. Snapshot/restore code that needs the own-pause flag uses the concrete
ScyllaClock type directly.
Properties
CurrentPauseMode
The current pause mode. None when not paused. Soft and Hard pauses differ in how downstream consumers (per-clock pause-respect flags, UI subsystems) decide whether to keep ticking through the pause window. Implementations that do not distinguish modes should return Hard while paused.
Declaration
PauseMode CurrentPauseMode { get; }
Property Value
| Type | Description |
|---|---|
| PauseMode |
CurrentTickMilliseconds
The clock's canonical accumulated time in milliseconds. For the global
ScyllaTime source this tracks an in-process millisecond accumulator
advanced from UnityEngine.Time.unscaledTime; for individual clocks it is
the clock's own monotonic tick value, which can be negative for backward-running
clocks.
Declaration
long CurrentTickMilliseconds { get; }
Property Value
| Type | Description |
|---|---|
| long |
IsPaused
Whether this source is currently paused.
Declaration
bool IsPaused { get; }
Property Value
| Type | Description |
|---|---|
| bool |
TimeScale
The current effective time scale applied by this source.
A value of 1 means real-time speed; 0 means frozen.
Returns the effective scale (after any modifier stack) when modifiers are active.
Declaration
float TimeScale { get; }
Property Value
| Type | Description |
|---|---|
| float |
UnscaledDeltaTime
Real-world seconds elapsed since the last tick, unaffected by time scale or pause.
Equivalent to UnityEngine.Time.unscaledDeltaTime for the global clock.
Declaration
float UnscaledDeltaTime { get; }
Property Value
| Type | Description |
|---|---|
| float |