Class ClockDefinition
Designer-authored ScriptableObject specifying the configuration of a single ScyllaClock. Multiple clocks may share a calendar but each clock has its own ID, rate, paused state, and listener lifecycle.
Inherited Members
Namespace: Scylla.Core.Time
Assembly: ScyllaCore.dll
Syntax
[CreateAssetMenu(fileName = "Clock Definition", menuName = "Scylla/Time/Clock Definition")]
public sealed class ClockDefinition : ScriptableObject
Remarks
A project typically authors several ClockDefinition assets:
a master clock for gameplay, a UI clock that ignores global pause, and (for
simulation games) per-region or per-body clocks. The IsMasterClock
flag designates one of them as the source whose effective rate is mirrored
to UnityEngine.Time.timeScale.
Reserved fields (Scylla.Core.Time.ClockDefinition.LocationProfileAsset, Scylla.Core.Time.ClockDefinition.NetworkSyncStrategyAsset)
are typed as UnityEngine.ScriptableObject in the Inspector because their interface
contracts (ILocationProfile, INetworkTimeSyncStrategy)
are stubs in the Reserved folder; the accessors cast to the interface
and return null if no implementation is supplied. Today no implementations
exist and the runtime treats these fields as inactive.
Fields
DEFAULT_BASE_TICK_RATE
Default real-seconds-per-real-second for a clock that runs at wall-clock speed.
Declaration
public const float DEFAULT_BASE_TICK_RATE = 1
Field Value
| Type | Description |
|---|---|
| float |
DEFAULT_DETERMINISTIC_STEP_SECONDS
Default fixed-step interval (in seconds) when DeterministicMode is enabled.
Declaration
public const float DEFAULT_DETERMINISTIC_STEP_SECONDS = 0.016666668
Field Value
| Type | Description |
|---|---|
| float |
Properties
BaseTickRate
Base in-game seconds per real second.
Declaration
public float BaseTickRate { get; }
Property Value
| Type | Description |
|---|---|
| float |
Calendar
Calendar used to interpret this clock's tick count. May be null for timer-only
clocks that do not need calendar boundaries; calendar-less clocks still tick and fire
scheduler callbacks but produce no boundary events and return
default(Calendar.GameDate) from Clock.ScyllaClock.CurrentDate.
Declaration
public CalendarDefinition Calendar { get; }
Property Value
| Type | Description |
|---|---|
| CalendarDefinition |
ClockID
Unique clock identifier.
Declaration
public string ClockID { get; }
Property Value
| Type | Description |
|---|---|
| string |
DeterministicMode
Whether the clock advances by a fixed step regardless of deltaTime.
Declaration
public bool DeterministicMode { get; }
Property Value
| Type | Description |
|---|---|
| bool |
DeterministicStepSeconds
Fixed step size in real seconds when DeterministicMode is on.
Declaration
public float DeterministicStepSeconds { get; }
Property Value
| Type | Description |
|---|---|
| float |
DisplayName
Human-readable display name.
Declaration
public string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
EmitTickEvents
Whether the clock emits per-tick events.
Declaration
public bool EmitTickEvents { get; }
Property Value
| Type | Description |
|---|---|
| bool |
InitialDay
Initial 1-based day-of-month.
Declaration
public int InitialDay { get; }
Property Value
| Type | Description |
|---|---|
| int |
InitialHour
Initial hour (0-based).
Declaration
public int InitialHour { get; }
Property Value
| Type | Description |
|---|---|
| int |
InitialMinute
Initial minute (0-based).
Declaration
public int InitialMinute { get; }
Property Value
| Type | Description |
|---|---|
| int |
InitialMonth
Initial zero-based month index.
Declaration
public int InitialMonth { get; }
Property Value
| Type | Description |
|---|---|
| int |
InitialSecond
Initial second (0-based).
Declaration
public int InitialSecond { get; }
Property Value
| Type | Description |
|---|---|
| int |
InitialSpeedMultiplier
Initial value of SpeedMultiplier.
Declaration
public float InitialSpeedMultiplier { get; }
Property Value
| Type | Description |
|---|---|
| float |
InitialYear
Initial year in the calendar's display year (already includes EpochYearOffset).
Declaration
public int InitialYear { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsMasterClock
Whether this clock is the project's master clock.
Declaration
public bool IsMasterClock { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LocationProfile
Cast accessor returning ILocationProfile when an implementation is assigned.
Declaration
public ILocationProfile LocationProfile { get; }
Property Value
| Type | Description |
|---|---|
| ILocationProfile |
NetworkSyncStrategy
Cast accessor returning INetworkTimeSyncStrategy when an implementation is assigned.
Declaration
public INetworkTimeSyncStrategy NetworkSyncStrategy { get; }
Property Value
| Type | Description |
|---|---|
| INetworkTimeSyncStrategy |
PersistOnSnapshot
Whether this clock persists on snapshot/restore.
Declaration
public bool PersistOnSnapshot { get; }
Property Value
| Type | Description |
|---|---|
| bool |
RespectsGlobalPause
Whether this clock pauses when the global ScyllaTime is paused.
Declaration
public bool RespectsGlobalPause { get; }
Property Value
| Type | Description |
|---|---|
| bool |
RespectsGlobalTimeScale
Whether this clock's rate is scaled by the global ScyllaTime.TimeScale.
Declaration
public bool RespectsGlobalTimeScale { get; }
Property Value
| Type | Description |
|---|---|
| bool |
StartPaused
Whether the clock starts paused.
Declaration
public bool StartPaused { get; }
Property Value
| Type | Description |
|---|---|
| bool |