Search Issue Tracker
Fixed in 2022.1.X
Votes
0
Found in
2018.4
2019.4
2020.3
2021.1
2021.2
2021.2.0a15
Issue ID
1335981
Regression
No
[Simulator] Wrong Screen.width/height values returned in OnEnable when reenabling a monobehavior in the editor during PlayMode
How to reproduce:
1. Open attached project "BadResolution.zip"
2. Open "SampleScene" scene
3. Enter Play Mode
4. Select "Script" Game Object in the Hierarchy window
5. Disable "Find Resolution Printer" component in the Inspector window
6. Enable "Find Resolution Printer" component in the Inspector window
7. Observe the Console window
Expected result: The resolution printed is the same as the resolution printed at the start of the Play Mode
Actual result: The resolution printed is different
Reproducible with - 2018.4.35f1, 2019.4.27f1, 2020.3.9f1, 2021.1.8f1, 2021.2.0a17
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0a13
Was not able to fix UnityEngine.Screen behavior, but fixed UnityEngine.Device.Screen behavior to be stable when using Device Simulator. Won't work with Game window and won't work with UnityEngine.Screen.