# AsyncOperation

> Class representing an asynchronous operation, which can be used as a yield instruction in a coroutine or awaited with the await operator.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Inherits from:** [YieldInstruction](/engine/6000.0/script-reference/unityengine/yieldinstruction.md)

```csharp
public class AsyncOperation : YieldInstruction
```

## Remarks

`AsyncOperation` inherits from [YieldInstruction](/engine/6000.0/script-reference/unityengine/yieldinstruction.md) and can be `yield` returned from a coroutine. You can also perform actions like the following:

* Check its progress without any coroutine, for example checking [AsyncOperation.isDone](/engine/6000.0/script-reference/unityengine/asyncoperation/isdone.md) or [AsyncOperation.progress](/engine/6000.0/script-reference/unityengine/asyncoperation/progress.md) inside [MonoBehaviour.Update()](/engine/6000.0/script-reference/unityengine/monobehaviour/update.md).
* Subscribe to its completed event [AsyncOperation.completed](/engine/6000.0/script-reference/unityengine/asyncoperation/completed.md) to receive a callback when it finishes.
* Adjust properties such as [AsyncOperation.allowSceneActivation](/engine/6000.0/script-reference/unityengine/asyncoperation/allowsceneactivation.md) while it's running.
* Await its completion with the `await` key word as part of Unity's [Awaitable](/engine/6000.0/script-reference/unityengine/awaitable.md) support.

Additional Resources: [SceneManager.LoadSceneAsync](/engine/6000.0/script-reference/unityengine/scenemanagement/scenemanager/loadsceneasync.md), [AssetBundle.LoadAssetAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadassetasync.md), [Resources.LoadAsync](/engine/6000.0/script-reference/unityengine/resources/loadasync.md).

## Examples

```csharp
using System.Collections;
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    public void Start()
    {
        StartCoroutine(Example_AsyncTests());
    }

    public IEnumerator Example_AsyncTests()
    {
        Debug.Log("Start of AsyncLoad Example");

        var load = UnityEngine.Resources.LoadAsync("");
        yield return load;
        yield return null;

        Debug.Log("End of AsyncLoad Example");
    }
}
```

## Properties

| Property                                                                                                   | Description                                                                                                                                   |
| ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [allowSceneActivation](/engine/6000.0/script-reference/unityengine/asyncoperation/allowsceneactivation.md) | Allows a scene to be activated as soon as it's ready.                                                                                         |
| [isDone](/engine/6000.0/script-reference/unityengine/asyncoperation/isdone.md)                             | When the value is true, then the operation has finished. Otherwise, the operation is in progress. (Read Only)                                 |
| [priority](/engine/6000.0/script-reference/unityengine/asyncoperation/priority.md)                         | Integer representing the execution order priority of this AsyncOperation.                                                                     |
| [progress](/engine/6000.0/script-reference/unityengine/asyncoperation/progress.md)                         | A floating point value representing the operation's current state of progress toward completion, where 1.0 represents completion. (Read Only) |

## Events

| Member                                                                               | Description                                              |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| [completed](/engine/6000.0/script-reference/unityengine/asyncoperation/completed.md) | Raised when this AsyncOperation operation has completed. |
