Class MarsTime
Provides access to frame-rate independent time information for the MARS lifecycle
Namespace: Unity.MARS
Syntax
public static class MarsTime
Properties
FrameCount
The total number of MarsUpdates that have occurred
Declaration
public static int FrameCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Paused
Whether MarsUpdates are paused
Declaration
public static bool Paused { get; }
Property Value
Type | Description |
---|---|
Boolean |
ScaledDeltaTime
Unity
Declaration
public static float ScaledDeltaTime { get; }
Property Value
Type | Description |
---|---|
Single |
Time
The time the latest MarsUpdate has started. This is the time in seconds since the start of the MARS lifecycle. This scales with TimeScale.
Declaration
public static float Time { get; }
Property Value
Type | Description |
---|---|
Single |
TimeScale
The scale at which Time passes. This is 1 at the start of the MARS lifecycle.
When TimeScale is 1, MARS Time passes at the same rate as Unity
Declaration
public static float TimeScale { get; set; }
Property Value
Type | Description |
---|---|
Single |
TimeStep
The fixed interval in seconds at which MarsUpdates are performed. This is not affected by TimeScale.
Declaration
public static float TimeStep { get; }
Property Value
Type | Description |
---|---|
Single |
Methods
Pause()
Sets TimeScale to 0 and stops MarsUpdates from running for the rest of the frame and until TimeScale is set to a positive value
Declaration
public static void Pause()
Play()
If Paused is true, sets TimeScale to 1 and starts MarsUpdates running. Does nothing if Paused is false.
Declaration
public static void Play()
Events
MarsUpdate
Called every TimeStep seconds while the MARS lifecycle is running. The frequency of MARS updates per player loop update scales with TimeScale.
Declaration
public static event Action MarsUpdate
Event Type
Type | Description |
---|---|
Action |