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.Requester< T > Class Template Referenceabstract

Base class for asset bundle requesters of various objects or scenes. More...

Public Member Functions

bool TryGetAssetRetrievalResult (out AssetRetrievalResult assetRetrievalResult)
 Gets status of last download attempt for an asset. Note: If an asset was pulled from the cache, it will return response code 200 with UnityWebRequest.Result.Success.
 
async Task< AssetBundle > GetAssetBundle (Progress< AssetRetrievalProgress > progress=null)
 Retrieves this components Asset from the CDN.
 
async Task< T > GetAsset (Progress< AssetRetrievalProgress > progress=null, Action< T > onSuccess=null, Action< AssetRetrievalResult > onFailure=null, bool waitForManagerInit=true)
 Retrieves an asset from the content delivery network.
 

Properties

UnityEvent OnRetrievalStarted = new UnityEvent() [get]
 Fires when retrieval starts. Useful for starting up a loading bar.
 
UnityEvent< float > OnProgressUpdated = new UnityEvent<float>() [get]
 Fires when download / load progress changes. Includes a float between 0 and 1 representing progress.
 
UnityEvent< long > OnRetrievalFailed = new UnityEvent<long>() [get]
 Fires when an asset retrieval attempt did not work. Includes a long integer http status code
 
UnityEvent OnRetrievalSuccess = new UnityEvent() [get]
 Fires when an asset retrieval attempt succeeded.
 

Detailed Description

Base class for asset bundle requesters of various objects or scenes.

Type Constraints
T :UnityEngine.Object 

Member Function Documentation

◆ GetAsset()

async Task< T > SplenSoft.AssetBundles.Requester< T >.GetAsset ( Progress< AssetRetrievalProgress > progress = null,
Action< T > onSuccess = null,
Action< AssetRetrievalResult > onFailure = null,
bool waitForManagerInit = true )

Retrieves an asset from the content delivery network.

Template Parameters
TAny UnityEngine.Object derivative type, such as GameObject or Sprite

◆ GetAssetBundle()

async Task< AssetBundle > SplenSoft.AssetBundles.Requester< T >.GetAssetBundle ( Progress< AssetRetrievalProgress > progress = null)

Retrieves this components Asset from the CDN.

Parameters
progressOptional custom progress tracker
Returns
A Task object

◆ TryGetAssetRetrievalResult()

bool SplenSoft.AssetBundles.Requester< T >.TryGetAssetRetrievalResult ( out AssetRetrievalResult assetRetrievalResult)

Gets status of last download attempt for an asset. Note: If an asset was pulled from the cache, it will return response code 200 with UnityWebRequest.Result.Success.

Parameters
assetRetrievalResult
Returns
True if at least one attempt was made to retrieve the manifest prior to this call

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