Table of Contents

Class WebFrameLoop

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Caps the client's render rate without taking the web player off the browser's animation frames.

public static class WebFrameLoop
Inheritance
WebFrameLoop
Inherited Members

Remarks

On the web, any UnityEngine.Application.targetFrameRate but -1 makes Unity schedule every frame with setTimeout, out of step with the display; Firefox then presented the canvas out of order and the whole picture snapped back and forth (FrameLoop.jslib has the measurement). There the loop stays on animation frames (targetFrameRate -1) and the cap is applied as every Nth display frame. Only in Firefox: every other browser, and every other platform, uses UnityEngine.Application.targetFrameRate as before, so it is not held to the display rate.

Methods

SetCap(int)

Caps the render rate at framesPerSecond (on the web, at least that, in whole display frames).

public static void SetCap(int framesPerSecond)

Parameters

framesPerSecond int