Class Time
Game ticking and timing system.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public static class Time : Object
Properties
DeltaTime
Gets time in seconds it took to complete the last frame, TimeScale dependent.
Declaration
[Unmanaged]
public static float DeltaTime { get; }
Property Value
System.Single
|
DrawFPS
The target amount of the frames rendered per second (target game FPS).
Declaration
[Unmanaged]
public static float DrawFPS { get; set; }
Property Value
System.Single
|
Remarks
To get the actual game FPS use FramesPerSecond
GamePaused
Gets or sets the value indicating whenever game logic is paused (physics, script updates, etc.).
Declaration
[Unmanaged]
public static bool GamePaused { get; set; }
Property Value
System.Boolean
|
GameTime
Gets time at the beginning of this frame. This is the time in seconds since the start of the game.
Declaration
[Unmanaged]
public static float GameTime { get; }
Property Value
System.Single
|
PhysicsFPS
The target amount of the physics simulation updates per second (also fixed updates frequency).
Declaration
[Unmanaged]
public static float PhysicsFPS { get; set; }
Property Value
System.Single
|
StartupTime
The time at which the game started (UTC local).
Declaration
[Unmanaged]
public static DateTime StartupTime { get; }
Property Value
System.DateTime
|
TimeScale
The game time scale factor. Default is 1.
Declaration
[Unmanaged]
public static float TimeScale { get; set; }
Property Value
System.Single
|
TimeSinceStartup
Gets the time since startup in seconds (unscaled).
Declaration
[Unmanaged]
public static float TimeSinceStartup { get; }
Property Value
System.Single
|
UnscaledDeltaTime
Gets timeScale-independent time in seconds it took to complete the last frame.
Declaration
[Unmanaged]
public static float UnscaledDeltaTime { get; }
Property Value
System.Single
|
UnscaledGameTime
Gets timeScale-independent time at the beginning of this frame. This is the time in seconds since the start of the game.
Declaration
[Unmanaged]
public static float UnscaledGameTime { get; }
Property Value
System.Single
|
UpdateFPS
The target amount of the game logic updates per second (script updates frequency).
Declaration
[Unmanaged]
public static float UpdateFPS { get; set; }
Property Value
System.Single
|
Methods
SetFixedDeltaTime(Boolean, Single)
Sets the fixed FPS for game logic updates (draw and update).
Declaration
[Unmanaged]
public static void SetFixedDeltaTime(bool enable, float value)
Parameters
System.Boolean
enable
True if enable this feature, otherwise false. |
System.Single
value
The fixed draw/update rate for the time. |
Synchronize()
Synchronizes update, fixed update and draw. Resets any pending deltas for fresh ticking in sync.
Declaration
[Unmanaged]
public static void Synchronize()