How to resolve editor warnings: Because this call is not awaited #105
-
When I write the following code in the editor, code like this:
The Editor will display a warning:
How to solve this warning? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There are multiple ways to suppress the warning and the easiest one I found is this one: https://stackoverflow.com/a/47790150/1951038 This warning appears because Tween and Sequence are both awaitable types and C# thinks that a user may have forgotten to call await in async method. But now I think whether it was a design mistake on my part to make Tween/Sequence awaitable types instead of introducing a separate |
Beta Was this translation helpful? Give feedback.
There are multiple ways to suppress the warning and the easiest one I found is this one: https://stackoverflow.com/a/47790150/1951038
This warning appears because Tween and Sequence are both awaitable types and C# thinks that a user may have forgotten to call await in async method. But now I think whether it was a design mistake on my part to make Tween/Sequence awaitable types instead of introducing a separate
ToAwaitable()
method that a user should call when they want to await an animation.