浏览代码

Adapt frame rate.

/main
Yuncong Zhang 6 年前
当前提交
d5de12d3
共有 1 个文件被更改,包括 17 次插入1 次删除
  1. 18
      Runtime/editor/editor_window.cs

18
Runtime/editor/editor_window.cs


bool _alive;
Timer scheduleFrameTimer = null;
public bool alive {
get { return this._alive; }
}

D.assert(this._surface != null);
this._surface.Dispose();
this._surface = null;
QualitySettings.vSyncCount = 0;
}
public override IDisposable getScope() {

if (regenerateLayerTree) {
this._regenerateLayerTree = true;
}
}
Application.targetFrameRate = 60;
this.scheduleFrameTimer?.cancel();
this.scheduleFrameTimer = instance.run(
new TimeSpan(0, 0, 0, 1),
() => {
if (Application.targetFrameRate > 10)
Application.targetFrameRate -= 10;
else {
Application.targetFrameRate = 10;
this.scheduleFrameTimer.cancel();
this.scheduleFrameTimer = null;
}
}, true);
}
public override void render(Scene scene) {
var layerTree = scene.takeLayerTree();

正在加载...
取消
保存