@@ -182,13 +182,6 @@ public void OnEnable() {
182
182
this . _devicePixelRatio = this . queryDevicePixelRatio ( ) ;
183
183
this . _antiAliasing = this . queryAntiAliasing ( ) ;
184
184
185
- var size = this . queryWindowSize ( ) ;
186
- this . _lastWindowWidth = size . x ;
187
- this . _lastWindowHeight = size . y ;
188
- this . _physicalSize = new Size (
189
- this . _lastWindowWidth * this . _devicePixelRatio ,
190
- this . _lastWindowHeight * this . _devicePixelRatio ) ;
191
-
192
185
this . updateSafeArea ( ) ;
193
186
D . assert ( this . _surface == null ) ;
194
187
this . _surface = this . createSurface ( ) ;
@@ -444,6 +437,15 @@ void _updateScrollInput(float deltaTime) {
444
437
}
445
438
446
439
public void Update ( ) {
440
+ if ( this . _physicalSize == null ) {
441
+ var size = this . queryWindowSize ( ) ;
442
+ this . _lastWindowWidth = size . x ;
443
+ this . _lastWindowHeight = size . y ;
444
+ this . _physicalSize = new Size (
445
+ this . _lastWindowWidth * this . _devicePixelRatio ,
446
+ this . _lastWindowHeight * this . _devicePixelRatio ) ;
447
+ }
448
+
447
449
this . updateDeltaTime ( ) ;
448
450
this . updateFPS ( this . unscaledDeltaTime ) ;
449
451
@@ -458,10 +460,10 @@ public void Update() {
458
460
this . flushMicrotasks ( ) ;
459
461
}
460
462
}
461
-
463
+
462
464
static readonly TimeSpan _coolDownDelay = new TimeSpan ( 0 , 0 , 0 , 0 , 200 ) ;
463
465
static Timer frameCoolDownTimer ;
464
-
466
+
465
467
public override void scheduleFrame ( bool regenerateLayerTree = true ) {
466
468
if ( regenerateLayerTree ) {
467
469
this . _regenerateLayerTree = true ;
0 commit comments