Table of Contents

Class AsyncOperationExtensions

Namespace
TAssetBundle.Extensions
Assembly
TAssetBundle.Extensions.dll

Static class providing extension methods for AsyncOperation.

public static class AsyncOperationExtensions
Inheritance
AsyncOperationExtensions
Inherited Members

Methods

ToTask(AsyncOperation)

Converts the AsyncOperation to a Task and awaits until the operation is complete.

public static Task ToTask(this AsyncOperation asyncOperation)

Parameters

asyncOperation AsyncOperation

The asynchronous operation to await.

Returns

Task

A Task that completes when the operation is done.

ToTask<T>(AsyncOperation<T>)

Converts the AsyncOperation<T> to a Task and awaits until the operation is complete, returning the result.

public static Task<T> ToTask<T>(this AsyncOperation<T> asyncOperation)

Parameters

asyncOperation AsyncOperation<T>

The asynchronous operation to await.

Returns

Task<T>

A Task that completes when the operation is done and returns the result.

Type Parameters

T

The result type of the operation.