Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.4.0f1
2019.2.0a1
2019.3.0a1
2020.1.0a1
Issue ID
1195439
Regression
No
Argument exception is thrown on drawing the next button after coming back from a task when using async/await
Steps to reproduce:
1. Create a new project
2. Attach the provided script ("Foo.cs") to any GameObject in the Scene
3. Press on the GameObject which has the script attached
4. In GameObjects Inspector press "Do time consuming stuff" Button
Expected result: No errors or exceptions are thrown
Actual result: "ArgumentException: You can only call GUI functions from inside OnGUI." exception is thrown
Reproducible with: 2018.4.13f1, 2019.2.13f1, 2019.3.0b11, 2020.1.0a13
Couldn't test with: 2017.4 due to "Feature `asynchronous functions' cannot be used because it is not part of the C# 4.0 language specification"
Notes:
- In 2019.2.0a1 the exception is thrown constantly without end
- Buttons that are drawn before the button that runs a task don't throw any exceptions when the button that runs the task is pressed
- The bug reproduces the same both in Play Mode and Edit Mode
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
- Physics Used Memory keeps growing when GameObject colliders are enabled and disabled
- Errors are thrown and Inspector's UI element is not drawing when a GameObject with script component using a List<T> attached is selected
- ConfigurableJoint's parameters are not saved in the Prefab after Runtime Prefab baking
- Popup windows spawn on the incorrect monitor when the Editor is placed near the boundary of scaled monitor next to a monitor with different scaling
- Hidden Tabs do not shift into empty space after closing visible Tabs
Resolution Note (2020.1.X):
Low priority defect and unlikely to be fixed for the near future.