- Home /
Updating UI in Editor mode while Application is paused
So I have a very specific issue, which I have been battling with for several hours.
I am trying to create a tool that automatically makes screenshots in different resolutions of your game. The tool works fine, while the game is in playmode. However, it takes a screenshot once per frame, so if objects are moving every frame, every screenshot will be slightly different.
My solution was to pause the Unity editor (EditorApplication.isPaused = true). However, now when I resize the GameView window, my UI does not update. This only happens when I go the next frame manually.
How to reproduce:
Create a Canvas with an image anchored to the top right.
Press Play, then Pause.
Resize the GameView.
You will see how the GameView resizes, but the image does not stay in the corner. If you press 'Next Frame', it will also resize the UI. My question is, how can I make the UI resize in the same frame?
Things I tried:
Canvas.ForceUpdateCanvases ();
SceneView.RepaintAll ();
Using Reflection to literally call every method on the GameView EditorWindow
Calling Update, LateUpdate on every single GameObject in my Canvas (using BroadcastMessage)
It seems like the resizing of the UI happens in a magical place to which I have no access. Any Unity Editor experts who can shed some light on this issue?
See pdf for more infolink text
Cheers
Any news on the issue? I have similar issue where in an editor script I update some Unity UI objects in editor mode (not playmode) and it does not update unless I right click or scroll in the gameview.
Your answer
![](https://koobas.hobune.stream/wayback/20220612051049im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Resize every GameObject after screen resolution? 1 Answer
Initialising List array for use in a custom Editor 1 Answer
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer