@@ -163,6 +163,16 @@ protected virtual TimeSpan getTime() {
163
163
164
164
protected float deltaTime ;
165
165
protected float unscaledDeltaTime ;
166
+
167
+ void updatePhysicalSize ( ) {
168
+ var size = this . queryWindowSize ( ) ;
169
+ this . _lastWindowWidth = size . x ;
170
+ this . _lastWindowHeight = size . y ;
171
+ this . _physicalSize = new Size (
172
+ this . _lastWindowWidth * this . _devicePixelRatio ,
173
+ this . _lastWindowHeight * this . _devicePixelRatio ) ;
174
+ }
175
+
166
176
167
177
protected virtual void updateDeltaTime ( ) {
168
178
this . deltaTime = Time . unscaledDeltaTime ;
@@ -175,19 +185,13 @@ protected virtual void updateSafeArea() {
175
185
public void onViewMetricsChanged ( ) {
176
186
this . _viewMetricsChanged = true ;
177
187
}
178
-
188
+
179
189
protected abstract bool hasFocus ( ) ;
180
190
181
191
public void OnEnable ( ) {
182
192
this . _devicePixelRatio = this . queryDevicePixelRatio ( ) ;
183
193
this . _antiAliasing = this . queryAntiAliasing ( ) ;
184
- var size = this . queryWindowSize ( ) ;
185
- this . _lastWindowWidth = size . x ;
186
- this . _lastWindowHeight = size . y ;
187
- this . _physicalSize = new Size (
188
- this . _lastWindowWidth * this . _devicePixelRatio ,
189
- this . _lastWindowHeight * this . _devicePixelRatio ) ;
190
-
194
+ this . updatePhysicalSize ( ) ;
191
195
this . updateSafeArea ( ) ;
192
196
D . assert ( this . _surface == null ) ;
193
197
this . _surface = this . createSurface ( ) ;
@@ -444,12 +448,7 @@ void _updateScrollInput(float deltaTime) {
444
448
445
449
public void Update ( ) {
446
450
if ( this . _physicalSize == null || this . _physicalSize . isEmpty ) {
447
- var size = this . queryWindowSize ( ) ;
448
- this . _lastWindowWidth = size . x ;
449
- this . _lastWindowHeight = size . y ;
450
- this . _physicalSize = new Size (
451
- this . _lastWindowWidth * this . _devicePixelRatio ,
452
- this . _lastWindowHeight * this . _devicePixelRatio ) ;
451
+ this . updatePhysicalSize ( ) ;
453
452
}
454
453
455
454
this . updateDeltaTime ( ) ;
0 commit comments