Class AssetBundleProvider
IResourceProvider for asset bundles. Loads bundles via UnityWebRequestAssetBundle API if the internalId starts with "http". If not, it will load the bundle via AssetBundle.LoadFromFileAsync.
WARNING: Direct bundle loading using this provider is NOT RECOMMENDED for most applications. Use Addressables.LoadAssetAsync<T>() to load individual assets instead, which provides automatic dependency resolution and better error handling.
This provider is for advanced scenarios only where manual bundle management is required.
Inherited Members
Namespace: UnityEngine.ResourceManagement.ResourceProviders
Assembly: Unity.ResourceManager.dll
Syntax
public class AssetBundleProvider : ResourceProviderBase, IResourceProvider, IInitializableObject
Properties
| Name | Description |
|---|---|
| SceneDependencyResourceType | The type to use when loading this provider's dependencies for a scene. Override this property to specify a different dependency type for your scene provider. |
| UnloadingBundles | Stores async operations that unload the requested AssetBundles. |
Methods
| Name | Description |
|---|---|
| CreateCacheKeyForLocation(ResourceManager, IResourceLocation, Type) | Creates the cache key used to lookup operations in the ResourceManager cache. Override this method to provide custom cache key generation for your provider. |
| GetDefaultType(IResourceLocation) | Get the default type of object that this provider can provide. |
| Provide(ProvideHandle) | Provide the object specified in the provideHandle. |
| Release(IResourceLocation, object) | Releases the asset bundle via AssetBundle.Unload(true). |
| ShouldRetryDownloadError(UnityWebRequestResult) | Determines if the web request can be retried based on its result info. |