Version: Unity 6.2 (6000.2)
Language : English
Simulate hitches for testing
Write and run coroutines

Split tasks across frames with coroutines

A coroutine is a method that can suspend execution and resume at a later time. In Unity, this means coroutines can start running in one frame and then resume in another, allowing you to spread tasks across several frames.

Topic Description
Write and run coroutines Write and run coroutine methods to do work that takes effect over several frames, such as a gradual fade-out effect.
Analyzing coroutines Analyze coroutine performance in the Unity ProfilerA window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating, or in your game logic. More info
See in Glossary
.
Yield instruction reference Yield different custom instructions in your coroutine methods to control when they resume.

Additional resources

Simulate hitches for testing
Write and run coroutines
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961