Public Member Functions | List of all members
IBundleDirectory Interface Reference

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

Detailed Description

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

All bundle labels are passed in as "sanitized", this translates them to "specific"

Sanitized bundlelabels must be app-wide globally unique, they are keys in a global table.

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

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

Inheritance diagram for IBundleDirectory:
PackedManifest UnityManifestBundleDirectory

Public Member Functions

bool  IsReady (BundleManager manager)
  Ready for requests? More...
 
bool  AmountToDownload (BundleManager manager, string sanitizedLabel, out uint totalSize, out uint alreadyDownloaded)
  How much is needed to download this? More...
 
IEnumerator  StartBundle (BundleManager manager, string sanitizedLabel)
  Do any pre-load tasks for a bundle that might take time. More...
 
bool  TryLookupBundle (BundleManager manager, string sanitizedLabel, out string outUrl, out Hash128 outHash, out string outCrc)
  Gather load-time info about bundle. More...
 
string  GetStreamingAssetsName (BundleManager manager, string sanitizedLabel, string url)
  Figure out what name to check for in StreamingAssets data for a given URL. More...
 
bool  TryGetDependencies (BundleManager manager, string sanitizedLabel, out IEnumerable< string > outRequiredSanitizedLabelList)
  What does this bundle depend on? More...
 

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
sanitizedLabel
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 UnityManifestBundleDirectory.

◆ 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
sanitizedLabel
url
Returns

Implemented in UnityManifestBundleDirectory, 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 UnityManifestBundleDirectory.

◆ StartBundle()

IEnumerator StartBundle ( BundleManager  manager,
string  sanitizedLabel 
)

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

Parameters
manager
Returns

Implemented in PackedManifest, and UnityManifestBundleDirectory.

◆ TryGetDependencies()

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

What does this bundle depend on?

Parameters
sanitizedLabel
outRequiredSanitizedLabelList
Returns
was bundle found?

Implemented in PackedManifest, and UnityManifestBundleDirectory.

◆ TryLookupBundle()

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

Gather load-time info about bundle.

Parameters
sanitizedLabel
outUrl
outHash
outCrc
Returns
was bundle found?

Implemented in PackedManifest, and UnityManifestBundleDirectory.