Awaitable
Note
This tutorial only applies to Unity 2023.1 or later.
Unity provides developers with an easy solution to calling a method after a delay. This method is called Invoke
. It has a pretty obvious benefit: It's easy to understand and use.
But unfortunately, there are far more drawbacks which make this method a candidate for obsoletion.
- It relies on string dependencies, and therefore is prone to typos which may not be caught until runtime
- It does not support parametered methods
- It relies on a distinct method to exist
- It uses reflection to find the method you provide
- You can't return a value