1.4 KiB
1.4 KiB
Asynchronous loading
The Addressables system API is asynchronous and returns an AsyncOperationHandle to use to manage operation progress and completion.
Addressables is designed to be content location agnostic. The content might need to be downloaded first or use other methods that can take a long time. To force synchronous execution, refer to Synchronous Addressables for more information.
When loading an asset for the first time, the handle is complete after a minimum of one frame. If the content has already loaded, execution times might differ between the various asynchronous loading options shown below. You can wait until the load has completed as follows:
- Coroutine: Always delayed at a minimum of one frame before execution continues.
Completedcallback: A minimum of one frame if the content hasn't already loaded, otherwise the callback is invoked in the same frame.- Awaiting
AsyncOperationHandle.Task: A minimum of one frame if the content hasn't already loaded, otherwise the execution continues in the same frame.
[!code-cssample]