浏览代码

Merge pull request #243 from UnityTech/optimizeViewMetricsUpdate

avoid mark viewMetrics dirty in update, which will potentially leads …
/main
GitHub 5 年前
当前提交
9d2c4be0
共有 3 个文件被更改,包括 10 次插入2 次删除
  1. 4
      Runtime/editor/editor_utils.cs
  2. 6
      Runtime/engine/DisplayMetrics.cs
  3. 2
      Runtime/engine/UIWidgetsPanel.cs

4
Runtime/editor/editor_utils.cs


public void OnEnable() {
this._lastDevicePixelRatio = GameViewUtil.getGameViewDevicePixelRatio();
}
public void onViewMetricsChanged() {
}
public float devicePixelRatio {
get { return this._lastDevicePixelRatio; }

6
Runtime/engine/DisplayMetrics.cs


void OnEnable();
void OnGUI();
void Update();
void onViewMetricsChanged();
float devicePixelRatio { get; }

}
public void Update() {
}
public void onViewMetricsChanged() {
public float devicePixelRatio {
get {

2
Runtime/engine/UIWidgetsPanel.cs


void _handleViewMetricsChanged(string method, List<JSONNode> args) {
this._windowAdapter.onViewMetricsChanged();
this._displayMetrics.Update();
this._displayMetrics.onViewMetricsChanged();
}
protected override void OnEnable() {

正在加载...
取消
保存