|
|
|
|
|
|
|
|
|
|
protected float deltaTime; |
|
|
|
protected float unscaledDeltaTime; |
|
|
|
|
|
|
|
void updatePhysicalSize() { |
|
|
|
var size = this.queryWindowSize(); |
|
|
|
this._lastWindowWidth = size.x; |
|
|
|
this._lastWindowHeight = size.y; |
|
|
|
this._physicalSize = new Size( |
|
|
|
this._lastWindowWidth * this._devicePixelRatio, |
|
|
|
this._lastWindowHeight * this._devicePixelRatio); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected virtual void updateDeltaTime() { |
|
|
|
this.deltaTime = Time.unscaledDeltaTime; |
|
|
|
|
|
|
public void onViewMetricsChanged() { |
|
|
|
this._viewMetricsChanged = true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var size = this.queryWindowSize(); |
|
|
|
this._lastWindowWidth = size.x; |
|
|
|
this._lastWindowHeight = size.y; |
|
|
|
this._physicalSize = new Size( |
|
|
|
this._lastWindowWidth * this._devicePixelRatio, |
|
|
|
this._lastWindowHeight * this._devicePixelRatio); |
|
|
|
|
|
|
|
this.updatePhysicalSize(); |
|
|
|
this.updateSafeArea(); |
|
|
|
D.assert(this._surface == null); |
|
|
|
this._surface = this.createSurface(); |
|
|
|
|
|
|
|
|
|
|
public void Update() { |
|
|
|
if (this._physicalSize == null || this._physicalSize.isEmpty) { |
|
|
|
var size = this.queryWindowSize(); |
|
|
|
this._lastWindowWidth = size.x; |
|
|
|
this._lastWindowHeight = size.y; |
|
|
|
this._physicalSize = new Size( |
|
|
|
this._lastWindowWidth * this._devicePixelRatio, |
|
|
|
this._lastWindowHeight * this._devicePixelRatio); |
|
|
|
this.updatePhysicalSize(); |
|
|
|
} |
|
|
|
|
|
|
|
this.updateDeltaTime(); |
|
|
|