A class in Root.Township, Alta.Utilities.
Server: scales the physics fixed timestep with server FPS, between the minimum and maximum physics rates in the server settings. ServerHandler starts it.
Constructors
1 private and internal constructor
Fields
4 private and internal fields
| Member | What it is |
|---|
private float nextUpdate | Real time of the next adjustment. |
private ServerSettings settings | The current server settings. |
private IUnityUpdateMethod update | Handle for the registered update method. |
private const float UpdateInterval | Seconds between adjustments (5). |
Methods
| Member | What it is |
|---|
static void Start() | Creates the instance, which hooks server settings changes and server end. |
4 private and internal methods
| Member | What it is |
|---|
private void Disable() | Sets the fixed timestep to the maximum physics frames per second and unregisters the update. |
private void SettingsChanged(Settings settings) | Re-reads the server settings and turns the update on or off by IsUpdatingPhysicsFixedFrameCount. |
private void Stop() | Runs when the server ends: unhooks the events and calls Disable. |
private void Update() | Every 5 seconds, maps current FPS between the two FPS settings onto a physics rate and sets Time.fixedDeltaTime. |