Class TimeScale
A MonoBehaviour that dynamically scales timeScale to maximize simulation throughput while staying within a target CPU utilization budget.
Inherited Members
Namespace: Unity.SimulationPro
Assembly: Unity.SimulationPro.Capture.dll
Syntax
public class TimeScale : MonoBehaviour
Remarks
When autoScale is enabled, the component measures average frame time each update and adjusts captureFramerate and timeScale so the CPU stays at targetUtilizationPercentage of the targetFrameRate budget. Disable autoScale to set a fixed timeScale manually.
Fields
autoScale
When true, the time-scale is computed automatically based on measured frame time and targetUtilizationPercentage.
Declaration
public bool autoScale
Field Value
| Type | Description |
|---|---|
| bool |
frameJitterDampening
Exponential smoothing factor (0–1) applied to the measured frame time to reduce jitter before computing the auto-scale value.
Declaration
public float frameJitterDampening
Field Value
| Type | Description |
|---|---|
| float |
targetFrameRate
The desired rendered frames per second used to compute the per-frame time budget.
Declaration
public int targetFrameRate
Field Value
| Type | Description |
|---|---|
| int |
targetUtilizationPercentage
The fraction (1–100) of the frame time budget the simulation is allowed to consume before the time-scale is reduced.
Declaration
public int targetUtilizationPercentage
Field Value
| Type | Description |
|---|---|
| int |
timeScale
The current time-scale multiplier applied to timeScale. Updated automatically when autoScale is enabled.
Declaration
public int timeScale
Field Value
| Type | Description |
|---|---|
| int |