浏览代码

Merge pull request #169 from Unity-Technologies/disable_default_ondemand_frame

minor fix + disable ondemand framerate by default
/main
GitHub 4 年前
当前提交
043d0f3e
共有 1 个文件被更改,包括 15 次插入2 次删除
  1. 17
      com.unity.uiwidgets/Runtime/scheduler/binding.cs

17
com.unity.uiwidgets/Runtime/scheduler/binding.cs


static readonly TimeSpan _coolDownDelay = new TimeSpan(0, 0, 0, 0, 200);
static Timer frameCoolDownTimer = null;
//disable auto adjust framerate by default
public static bool MEnableAutoAdjustFramerate = false;
public void scheduleFrame() {
if (hasScheduledFrame || !framesEnabled) {

Window.instance.scheduleFrame();
hasScheduledFrame = true;
adjustFrameRate();
}
void adjustFrameRate() {
if (!MEnableAutoAdjustFramerate) {
return;
}
onFrameRateSpeedUp();
frameCoolDownTimer?.cancel();
frameCoolDownTimer = Timer.create(_coolDownDelay,

);
}
public const int defaultMaxRenderFrameInterval = 200;
public const int defaultMinRenderFrameInterval = 1;
const int defaultMaxRenderFrameInterval = 200;
const int defaultMinRenderFrameInterval = 1;
void onFrameRateSpeedUp() {
OnDemandRendering.renderFrameInterval = defaultMinRenderFrameInterval;

ensureFrameCallbacksRegistered();
Window.instance.scheduleFrame();
hasScheduledFrame = true;
adjustFrameRate();
}
public void scheduleWarmUpFrame() {

正在加载...
取消
保存