Easy Content Delivery Network 1.3.2
An addressables-free suite that automatically handles the Unity Cloud Content Delivery API and packaging/deploying assetbundles while providing several tools to make asset management easy.
Loading...
Searching...
No Matches
SplenSoft.AssetBundles.AssetBundleData Class Reference

Data instantiated by AssetBundleManager on initialization. Each asset bundle in the AssetBundleManifest will have its own AssetBundleData entry. More...

Public Member Functions

void Flush (bool unloadAllLoadedObjects=false)
 Removes the AssetBundle and Asset from this cache so it can be garbage collected. Destroys Asset. Unloads the asset bundle from memory.
 

Properties

List< string > Dependencies = new List<string>() [get, set]
 List of asset bundle names that this asset bundle depends on. These should be loaded first, and will be loaded first automatically if the asset is requested through the AssetBundleManager
 
Object Asset [get, set]
 The actual asset that has been cached after successful retrieval. Can be used to instantiate the asset any time, as long as it's not null and as long as you know the type. Check Loaded to ensure the asset has been unpacked by the AssetBundleManager at least once to ensure this is not null.
 
AssetBundle AssetBundle [get, set]
 The asset bundle that has been cached after successful retrieval. Can be used to unpack its asset at any time, as long as its not null.
 
bool Loaded [get, set]
 Check this value to ensure the Asset is not null.
 
bool DownloadStarted [get, set]
 True if at least one attempt has been made to retrieve this asset.
 
Hash128 Hash [get, set]
 Used for caching.
 
long LastResponseCode [get, set]
 The last response code from a download attempt. Returns 0 if no download attempt was made, and can return 200 even if it was loaded from cache.
 
bool IsLoading [get, set]
 True if asset is currently being asynchronously loaded by Unity. Must be checked to ensure an asset is never loaded more than once if it's already loaded.
 

Detailed Description

Data instantiated by AssetBundleManager on initialization. Each asset bundle in the AssetBundleManifest will have its own AssetBundleData entry.

Member Function Documentation

◆ Flush()

void SplenSoft.AssetBundles.AssetBundleData.Flush ( bool unloadAllLoadedObjects = false)

Removes the AssetBundle and Asset from this cache so it can be garbage collected. Destroys Asset. Unloads the asset bundle from memory.

If you're looking to save memory without unloading the Asset, try AssetBundle.Unload instead.

Parameters
unloadAllLoadedObjectsIf true, all objects loaded from this asset bundle will also be unloaded. Use only if you're sure none of this asset bundle's assets are in the scene

The documentation for this class was generated from the following file: