Version: Unity 6.2 Alpha (6000.2)
Language : English
Code optimization
Introduction to asynchronous programming with Awaitable

Asynchronous programming with the Awaitable class

Asynchronous programming allows your code to perform long-running tasks without blocking the main thread. This allows your application to remain responsive and perform other tasks while it waits for an asynchronous task to complete.

Unity supports a simplified asynchronous programming model using the .NET async key word and await operator.

Before reading about asynchronous programming in Unity, make sure you understand the fundamental elements of asynchronous programming in .NET. For important context, refer to Asynchronous programming with async and await and Task asynchronous programming model.

Topic Description
Introduction to Awaitable Understand the key features of Unity’s Awaitable and how it compares to both .NET Task and iterator-based coroutines.
Awaitable completion and continuation Understand how asynchronous code resumes on completion of an awaited task and how this affects the function and performance of your application.
Awaitable code example reference Solve common asynchronous programming problems with a reference of Awaitable code examples.

Additional resources


对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答
Code optimization
Introduction to asynchronous programming with Awaitable
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961