Class UnityTimeProvider
Unity implementation of ITimeProvider.
This is the ONLY component that reads UnityEngine.Time.
Each frame it caches the scaled and unscaled deltas, then calls
UpdateTimers() so the timer service can
consume the cached values without touching the engine API.
Implements
Namespace: Serenity.Timer.Infrastructure.Components
Assembly: Serenity.UnityTimer.Infrastructure.dll
Syntax
public class UnityTimeProvider : MonoBehaviour, ITimeProvider
Constructors
UnityTimeProvider()
Declaration
public UnityTimeProvider()
Properties
ScaledDeltaSeconds
Declaration
public float ScaledDeltaSeconds { get; }
Property Value
| Type | Description |
|---|---|
| float |
UnscaledDeltaSeconds
Declaration
public float UnscaledDeltaSeconds { get; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Initialize(ITimerService)
Initializes the time provider with the timer service it will drive each frame.
Declaration
public void Initialize(ITimerService timerService)
Parameters
| Type | Name | Description |
|---|---|---|
| ITimerService | timerService | The timer service whose timers will be updated each frame. |