浏览代码

Merge pull request #367 from UnityTech/on_demand_rendering

Automatic adjust on demand rendering.
/main
GitHub 5 年前
当前提交
887f9fe3
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11
      Runtime/ui/window.cs

11
Runtime/ui/window.cs


using Unity.UIWidgets.editor;
using Unity.UIWidgets.foundation;
using UnityEngine;
using UnityEngine.Rendering;
namespace Unity.UIWidgets.ui {
public delegate void VoidCallback();

public const int defaultMaxTargetFrameRate = 60;
public const int defaultMinTargetFrameRate = 25;
public const int defaultMaxRenderFrameInterval = 100;
public const int defaultMinRenderFrameInterval = 1;
static Action _onFrameRateSpeedUp = defaultFrameRateSpeedUp;

}
static void defaultFrameRateSpeedUp() {
#if UNITY_2019_3_OR_NEWER
OnDemandRendering.renderFrameInterval = defaultMinRenderFrameInterval;
#else
#endif
}
static Action _onFrameRateCoolDown = defaultFrameRateCoolDown;

}
static void defaultFrameRateCoolDown() {
#if UNITY_2019_3_OR_NEWER
OnDemandRendering.renderFrameInterval = defaultMaxRenderFrameInterval;
#else
#endif
}
}
}
正在加载...
取消
保存