|
|
|
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using Unity.UIWidgets.async; |
|
|
|
using Unity.UIWidgets.editor; |
|
|
|
|
|
|
public override void scheduleFrame(bool regenerateLayerTree = true) { |
|
|
|
base.scheduleFrame(regenerateLayerTree); |
|
|
|
this._needsPaint = true; |
|
|
|
this._uiWidgetsPanel.speedUpFrameRate(); |
|
|
|
this._uiWidgetsPanel.coolDownFrameRate(); |
|
|
|
} |
|
|
|
|
|
|
|
public UIWidgetWindowAdapter(UIWidgetsPanel uiWidgetsPanel) { |
|
|
|
|
|
|
WindowAdapter _windowAdapter; |
|
|
|
Texture _texture; |
|
|
|
Vector2 _lastMouseMove; |
|
|
|
|
|
|
|
Timer scheduleFrameTimer; |
|
|
|
public const int defaultMaxTargetFrameRate = 60; |
|
|
|
public const int defaultMinTargetFrameRate = 15; |
|
|
|
|
|
|
|
HashSet<int> _enteredPointers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Window window { |
|
|
|
get { return this._windowAdapter; } |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void speedUpFrameRate() { |
|
|
|
Application.targetFrameRate = defaultMaxTargetFrameRate; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void coolDownFrameRate() { |
|
|
|
this.scheduleFrameTimer?.cancel(); |
|
|
|
this.scheduleFrameTimer = this.window.run( |
|
|
|
new TimeSpan(0, 0, 0, 0, 200), |
|
|
|
() => { |
|
|
|
Application.targetFrameRate = defaultMinTargetFrameRate; |
|
|
|
this.scheduleFrameTimer = null; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |