Public Member Functions | List of all members
IBundleManifest Interface Reference

Detailed Description

This is the minimum concrete runtime API BundleManager will use, usually loaded from disk.

All bundle names are passed in as "sanitized", meaning no Variants (bundleName.variant) or hashes (bundleName_123123098). It is the manifest's job to translate those to the current Variant and hash as needed.

Do not tie implementation to a single BundleManager. Might be used in multiple BundleManager instances.

These methods are listed in the order they'll be called at runtime for any given bundle.

We offer two concrete implementations, but you are not limited to them:

See IManifestLoader for a consistent API to load one of these concrete implementations.

Inheritance diagram for IBundleManifest:
PackedManifest UnityManifest

Public Member Functions

bool  IsReady (BundleManager manager)
 
bool  AmountToDownload (BundleManager manager, string sanitizedLabel, out uint totalSize, out uint alreadyDownloaded)
 
IEnumerator  StartBundle (BundleManager manager, string sanitizedLabel)
 
bool  TryLookupBundle (BundleManager manager, string sanitizedLabel, out string outUrl, out Hash128 outHash, out string outCrc)
 
string  GetStreamingAssetsName (BundleManager manager, string sanitizedLabel, string url)
 
bool  TryGetDependencies (BundleManager manager, string sanitizedLabel, out IEnumerable< string > outRequiredSanitizedLabelList)
 

Member Function Documentation

◆ AmountToDownload()

bool AmountToDownload ( BundleManager  manager,
string  sanitizedLabel,
out uint  totalSize,
out uint  alreadyDownloaded 
)

How much is needed to download this?

Parameters
manager Target manager
sanitizedLabel Requested bundle
totalSize How big the bundle is, regardless of how much has been downloaded
alreadyDownloaded How much still needs to be downloaded.
Returns
Was bundle found?

This will be called before StartBundle!

Return only this bundle's size. Caller will handle dependencies. This does require determining specific bundle to download, and if it's cached.

Implemented in PackedManifest, and UnityManifest.

◆ GetStreamingAssetsName()

string GetStreamingAssetsName ( BundleManager  manager,
string  sanitizedLabel,
string  url 
)

Figure out what name to check for in StreamingAssets data for a given URL.

In most cases this will remove the baseURL from the url this object calculated.

Parameters
manager Target manager
sanitizedLabel Requested bundle
url from TryLookupBundle.outUrl
Returns
filename

Implemented in UnityManifest, and PackedManifest.

◆ IsReady()

bool IsReady ( BundleManager  manager )

Ready for requests?

Once ready, presumed always ready. Please remember to wait for UnityEngine.Caching.ready before making network requests.

Implemented in PackedManifest, and UnityManifest.

◆ StartBundle()

IEnumerator StartBundle ( BundleManager  manager,
string  sanitizedLabel 
)

Do any pre-load tasks for a bundle that might take time.

Parameters
manager Target manager
sanitizedLabel Requested bundle
Returns
Coroutine source

Implemented in PackedManifest, and UnityManifest.

◆ TryGetDependencies()

bool TryGetDependencies ( BundleManager  manager,
string  sanitizedLabel,
out IEnumerable< string >  outRequiredSanitizedLabelList 
)

What does this bundle depend on?

Parameters
manager Target manager
sanitizedLabel Requested bundle
outRequiredSanitizedLabelList List of sanitized bundle names that will be needed.
Returns
was bundle found?

Implemented in PackedManifest, and UnityManifest.

◆ TryLookupBundle()

bool TryLookupBundle ( BundleManager  manager,
string  sanitizedLabel,
out string  outUrl,
out Hash128  outHash,
out string  outCrc 
)

Gather load-time info about bundle.

Parameters
manager Target manager
sanitizedLabel Requested bundle
outUrl Pass to WWW for download
outHash Pass to WWW for download
outCrc Pass to WWW for download
Returns
was bundle found?

Implemented in PackedManifest, and UnityManifest.