Use Unity's bundle manifest directly
Not recommended in production, it's not efficient. Prefer PackedManifest.
Classes | |
class | SpecificBundleName |
Public Member Functions | |
IOperation | Initialize (BundleManager manager, string absolutePath, int version, string baseUrl) |
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) |
bool | TryGetDependencies (BundleManager manager, string sanitizedLabel, out IEnumerable< string > outRequiredSanitizedLabelList) |
string | GetStreamingAssetsName (BundleManager manager, string sanitizedLabel, string url) |
Static Public Member Functions | |
static string | SanitizeBundleName (string assetBundleName, bool bundleNamesHaveHash) |
static SpecificBundleName | RemapBundleName_WithHash (string assetBundleName, AssetBundleManifest manifest, string[] activeVariants) |
static SpecificBundleName | RemapVariantName_NoHash (string assetBundleName, AssetBundleManifest manifest, string[] activeVariants) |
static string | EscapeBundleName (string source) |
Public Attributes | |
bool | escapeUrls = false |
bool | bundleNamesHaveHash = true |
Static Public Attributes | |
static ILogger | Logger |
Protected Member Functions | |
Hash128 | GetHashForAssetBundle (SpecificBundleName bundleName) |
IEnumerator | LoadManifest (BundleManager manager, string absolutePath, int version, string baseUrl, IGetVersion response) |
Protected Attributes | |
string | baseDownloadingURL |
Properties | |
IBundleManifest |
ActiveDirectory [get]
|
string[] |
ActiveVariants [get, set]
|
![]() | |
IBundleManifest |
ActiveDirectory [get]
|
bool AmountToDownload | ( | BundleManager | manager, |
string | sanitizedLabel, | ||
out uint | totalSize, | ||
out uint | alreadyDownloaded | ||
) |
How much is needed to download this?
manager | |
sanitizedLabel |
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.
Implements IBundleManifest.
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.
sanitizedLabel | |
url |
Implements IBundleManifest.
IOperation Initialize | ( | BundleManager | manager, |
string | absolutePath, | ||
int | version, | ||
string | baseUrl | ||
) |
Sets the source URL to the manifest and where all remote content is expected to be found.
Can be updated during application run for a version change.
version | If cached locally and version number matches, won't hit network |
absolutePath | manifest path. Not necessarily from baseUrl |
baseUrl | prepended to all bundle requests. Ends with slash. Typically BundleManager.GetUrlPath(absolutePath). |
Implements IManifestLoader.
bool IsReady | ( | BundleManager | manager | ) |
|
static |
Remaps the asset bundle name to the best fitting asset bundle.
|
static |
Remaps the asset bundle name to the best fitting asset bundle variant.
|
static |
Make requested bundle names consistent
IEnumerator StartBundle | ( | BundleManager | manager, |
string | sanitizedLabel | ||
) |
Do any pre-load tasks for a bundle that might take time.
manager |
Implements IBundleManifest.
bool TryGetDependencies | ( | BundleManager | manager, |
string | sanitizedLabel, | ||
out IEnumerable< string > | outRequiredSanitizedLabelList | ||
) |
What does this bundle depend on?
sanitizedLabel | |
outRequiredSanitizedLabelList |
Implements IBundleManifest.
bool TryLookupBundle | ( | BundleManager | manager, |
string | sanitizedLabel, | ||
out string | outUrl, | ||
out Hash128 | outHash, | ||
out string | outCrc | ||
) |
Gather load-time info about bundle.
sanitizedLabel | |
outUrl | |
outHash | |
outCrc |
Implements IBundleManifest.
bool bundleNamesHaveHash = true |
Were the asset bundles created with the BuildAssetBundleOptions.AppendHashToAssetBundleName on?
bool escapeUrls = false |
should we escape bundle names when making urls?
Proper naming makes this unnecessary, and doing so slows down loading.
|
static |
Assign a logging handler
|
get |
Get the current directory
Only valid after Initialize completes without error.
|
getset |
The list of bundle variants we should try to load
In highest to lowest priority order. Ignored for any bundle without a variant. Changes only affect bundles loaded in the future, not already loaded ones.