Coroutine
Related terms: yield, await, timer, multithreading
A function that can pause at a yield or await point and resume later with its local state intact. It makes sequences such as “open the door, wait, then close it” easier to express.
In common engine coroutine systems, the game loop keeps running while the coroutine waits. That does not make expensive work run on another thread: work before the next yield can still block a frame. Cancel pending sequences when their owner is gone.
- Further reading
- Unity: MonoBehaviour.StartCoroutine