Class LunyTimeServiceBase
public abstract class LunyTimeServiceBase : LunyEngineServiceBase, ILunyTimeService, ILunyEngineService
- Inheritance
-
objectLunyTimeServiceBase
- Implements
- Derived
- Inherited Members
Constructors
LunyTimeServiceBase()
protected LunyTimeServiceBase()
Properties
DeltaTime
Time since last frame update. Updates once after heartbeat. Value varies with framerate.
public double DeltaTime { get; }
Property Value
- double
Remarks
When read in a Heartbeat method, be aware that DeltaTime is last frame's deltaTime.
ElapsedSeconds
Gets the time in seconds since the application started. Uses real time (not affected by Time.timeScale).
public abstract double ElapsedSeconds { get; }
Property Value
- double
EngineFrameCount
Gets the engine's frame count since the application started.
public abstract long EngineFrameCount { get; }
Property Value
- long
Remarks
CAUTION: This value may differ between engines! Some engines start with frame 0, others in frame 1. Unity for instance launches in frame 0 where it runs Awake and OnEnable, but by Start it has incremented FrameCount to 1. While in Godot the entire first frame's FrameCount is 0. Prefer FrameCount since it is the same for all engines.
FixedDeltaTime
Time between two heartbeats. Value remains fixed (constant) at runtime.
public double FixedDeltaTime { get; }
Property Value
- double
FrameCount
Gets the total number of frames LunyEngine has run since launch. This value is consistent across engines.
public long FrameCount { get; }
Property Value
- long
Remarks
Initialization (startup, OnCreate, OnEnable) occurs in FrameCount 0. By OnReady (and before first OnHeartbeat/OnFrame) FrameCount will be 1.
HeartbeatCount
Gets the total number of heartbeats LunyEngine has run since launch. This value is consistent across engines.
public long HeartbeatCount { get; }
Property Value
- long