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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
Resolution Note (2020.1.X):
Low priority defect and unlikely to be fixed for the near future.