getAsync
Returns the reference to the asset wrapped with Deferred. Use Deferred.await to obtain the instance.
T is the type of the asset. Must match the type requested during loading. path must match the asset path passed during loading.
Note that while the result is a CompletableDeferred, it should never be completed manually. Instead, rely on the AssetStorage to load the asset.
Using Deferred.await might throw the following exceptions:
MissingAssetException if the asset at path was never added with load or add.
UnloadedAssetException if the asset was already unloaded asynchronously.
MissingLoaderException if the AssetLoader for asset of requested type is not registered.
InvalidLoaderException if the AssetLoader implementation of requested type is invalid.
AssetLoadingException if the AssetLoader has thrown an exception during loading.
MissingDependencyException is the AssetLoader is unable to obtain an instance of asset's dependency.
UnsupportedMethodException is the AssetLoader uses unsupported operation on AssetManagerWrapper.
Otherwise, using Deferred.await will suspend the coroutine until the asset is loaded and return its instance.
See also get and getOrNull for synchronous alternatives.
Returns the reference to the asset wrapped with Deferred. Use Deferred.await to obtain the instance. Throws AssetStorageException if the asset was unloaded or never scheduled to begin with.
T is the type of the asset. Must match the type requested during loading. descriptor contains the asset data. See getAssetDescriptor.
Note that while the result is a CompletableDeferred, it should never be completed manually. Instead, rely on the AssetStorage to load the asset.
Using Deferred.await might throw the following exceptions:
MissingAssetException if the asset was never added with load or add.
UnloadedAssetException if the asset was already unloaded asynchronously.
MissingLoaderException if the AssetLoader for asset of requested type is not registered.
InvalidLoaderException if the AssetLoader implementation of requested type is invalid.
AssetLoadingException if the AssetLoader has thrown an exception during loading.
MissingDependencyException is the AssetLoader is unable to obtain an instance of asset's dependency.
UnsupportedMethodException is the AssetLoader uses unsupported operation on AssetManagerWrapper.
Otherwise, using Deferred.await will suspend the coroutine until the asset is loaded and return its instance.
See also get and getOrNull for synchronous alternatives.
Returns the reference to the asset wrapped with Deferred. Use Deferred.await to obtain the instance.
T is the type of the asset. Must match the type requested during loading. identifier uniquely identifies a file by its path and type. See Identifier.
Note that while the result is a CompletableDeferred, it should never be completed manually. Instead, rely on the AssetStorage to load the asset.
Using Deferred.await might throw the following exceptions:
MissingAssetException if the asset with identifier was never added with load or add.
UnloadedAssetException if the asset was already unloaded asynchronously.
MissingLoaderException if the AssetLoader for asset of requested type is not registered.
InvalidLoaderException if the AssetLoader implementation of requested type is invalid.
AssetLoadingException if the AssetLoader has thrown an exception during loading.
MissingDependencyException is the AssetLoader is unable to obtain an instance of asset's dependency.
UnsupportedMethodException is the AssetLoader uses unsupported operation on AssetManagerWrapper.
Otherwise, using Deferred.await will suspend the coroutine until the asset is loaded and return its instance.