Table of Contents

Class AssetManager

Namespace
TAssetBundle
Assembly
TAssetBundle.dll

TAssetBundle Integrated Asset Manager

public static class AssetManager
Inheritance
AssetManager
Inherited Members

Properties

Settings

Get the settings

public static Settings Settings { get; }

Property Value

Settings

Methods

CheckCatalogUpdateAsync()

Check if the default catalog needs to be updated

public static TAsyncOperation<bool> CheckCatalogUpdateAsync()

Returns

TAsyncOperation<bool>

true if update is needed false otherwise

CheckCatalogUpdateAsync(string)

Check if a catalog with that name needs to be updated

public static TAsyncOperation<bool> CheckCatalogUpdateAsync(string catalogName)

Parameters

catalogName string

catalog name

Returns

TAsyncOperation<bool>

true if update is needed false otherwise

DownloadAsync()

Download the files you need to download from the default catalog

public static TAsyncOperationProgress<AssetBundleDownloadInfo> DownloadAsync()

Returns

TAsyncOperationProgress<AssetBundleDownloadInfo>

asset bundle download info

DownloadAsync(string)

Download the file you need to download from the catalog with that name.

public static TAsyncOperationProgress<AssetBundleDownloadInfo> DownloadAsync(string catalogName)

Parameters

catalogName string

catalog name

Returns

TAsyncOperationProgress<AssetBundleDownloadInfo>

asset bundle download info

DownloadByAssetsAsync(string[])

Download files that need to be downloaded among the asset bundles used by the assets.

public static TAsyncOperationProgress<AssetBundleDownloadInfo> DownloadByAssetsAsync(string[] assetPaths)

Parameters

assetPaths string[]

asset paths

Returns

TAsyncOperationProgress<AssetBundleDownloadInfo>

asset bundle download info

DownloadByAssetsAsync(AssetRef[])

Download files that need to be downloaded among the asset bundles used by the assets.

public static TAsyncOperationProgress<AssetBundleDownloadInfo> DownloadByAssetsAsync(AssetRef[] assetRefs)

Parameters

assetRefs AssetRef[]

asset references

Returns

TAsyncOperationProgress<AssetBundleDownloadInfo>

asset bundle download info

DownloadByScenesAsync(string[])

Download the files that need to be downloaded among the asset bundles used by the scene

public static TAsyncOperationProgress<AssetBundleDownloadInfo> DownloadByScenesAsync(string[] sceneNameOrPaths)

Parameters

sceneNameOrPaths string[]

scene names

Returns

TAsyncOperationProgress<AssetBundleDownloadInfo>

asset bundle download info

DownloadByScenesAsync(SceneAssetRef[])

Download the files that need to be downloaded among the asset bundles used by the scene

public static TAsyncOperationProgress<AssetBundleDownloadInfo> DownloadByScenesAsync(SceneAssetRef[] sceneAssetRefs)

Parameters

sceneAssetRefs SceneAssetRef[]

scene asset references

Returns

TAsyncOperationProgress<AssetBundleDownloadInfo>

asset bundle download info

DownloadByTagsAsync(string[])

Download files that need to be downloaded among asset bundles containing the tag

public static TAsyncOperationProgress<AssetBundleDownloadInfo> DownloadByTagsAsync(string[] tags)

Parameters

tags string[]

tags

Returns

TAsyncOperationProgress<AssetBundleDownloadInfo>

asset bundle download info

ExistAsset(string)

Whether the asset exists in the catalog

public static bool ExistAsset(string assetPath)

Parameters

assetPath string

asset path

Returns

bool

true if the asset exists, false otherwise

ExistAsset(AssetRef)

Whether the asset exists in the catalog

public static bool ExistAsset(AssetRef assetRef)

Parameters

assetRef AssetRef

asset reference

Returns

bool

true if the asset exists, false otherwise

ExistScene(string)

Check if a scene with that name exists

public static bool ExistScene(string sceneNameOrPath)

Parameters

sceneNameOrPath string

scene name

Returns

bool

true if exists, otherwise false

GetActiveAssetBundles()

Get the asset bundles currently in active

public static IEnumerable<IActiveAssetBundleInfo> GetActiveAssetBundles()

Returns

IEnumerable<IActiveAssetBundleInfo>

active asset bundle collection

GetDownloadSizeAsync()

Gets the total size of files to be downloaded from the default catalog

public static TAsyncOperation<long> GetDownloadSizeAsync()

Returns

TAsyncOperation<long>

file size

GetDownloadSizeAsync(string)

Gets the total size of the files to be downloaded from the catalog of that name

public static TAsyncOperation<long> GetDownloadSizeAsync(string catalogName)

Parameters

catalogName string

catalog name

Returns

TAsyncOperation<long>

file size

GetDownloadSizeByAssetsAsync(string[])

Get the total size of the files that need to be downloaded out of the asset bundles required by the asset.

public static TAsyncOperation<long> GetDownloadSizeByAssetsAsync(string[] assetPaths)

Parameters

assetPaths string[]

asset paths

Returns

TAsyncOperation<long>

file size

GetDownloadSizeByAssetsAsync(AssetRef[])

Get the total size of the files that need to be downloaded out of the asset bundles required by the asset.

public static TAsyncOperation<long> GetDownloadSizeByAssetsAsync(AssetRef[] assetRefs)

Parameters

assetRefs AssetRef[]

asset references

Returns

TAsyncOperation<long>

file size

GetDownloadSizeByScenesAsync(string[])

Get the total size of the files that need to be downloaded out of the asset bundles required for the scene.

public static TAsyncOperation<long> GetDownloadSizeByScenesAsync(string[] sceneNameOrPaths)

Parameters

sceneNameOrPaths string[]

scene names

Returns

TAsyncOperation<long>

file size

GetDownloadSizeByScenesAsync(SceneAssetRef[])

Get the total size of the files that need to be downloaded out of the asset bundles required for the scene.

public static TAsyncOperation<long> GetDownloadSizeByScenesAsync(SceneAssetRef[] sceneAssetRefs)

Parameters

sceneAssetRefs SceneAssetRef[]

scene asset references

Returns

TAsyncOperation<long>

file size

GetDownloadSizeByTagsAsync(string[])

Gets the total size of the files to download among asset bundles that contain that tag.

public static TAsyncOperation<long> GetDownloadSizeByTagsAsync(string[] tags)

Parameters

tags string[]

tags

Returns

TAsyncOperation<long>

file size

GetLastWebRequestError()

Last web request error information

public static UnityWebRequestError GetLastWebRequestError()

Returns

UnityWebRequestError

UnityWebRequestError

GetLoadedAssetHandles()

Get loaded asset handles

public static IEnumerable<IAssetHandle> GetLoadedAssetHandles()

Returns

IEnumerable<IAssetHandle>

asset handle collection

InitializeAsync()

Initialize

public static TAsyncOperation InitializeAsync()

Returns

TAsyncOperation

IsLoadedAsset(string)

Is the asset for that path loaded?

public static bool IsLoadedAsset(string assetPath)

Parameters

assetPath string

asset path

Returns

bool

true if the asset has been loaded false otherwise

IsLoadedAsset(AssetRef)

Is the asset for that assetRef loaded?

public static bool IsLoadedAsset(AssetRef assetRef)

Parameters

assetRef AssetRef

asset reference

Returns

bool

true if the asset has been loaded false otherwise

LoadAssetAsync<T>(string)

Load asset by asset path

public static TAsyncOperation<IAssetHandle<T>> LoadAssetAsync<T>(string assetPath) where T : Object

Parameters

assetPath string

asset path

Returns

TAsyncOperation<IAssetHandle<T>>

A handle to that asset

Type Parameters

T

asset type

LoadAssetAsync<T>(AssetRef)

Load asset by asset reference

public static TAsyncOperation<IAssetHandle<T>> LoadAssetAsync<T>(AssetRef assetRef) where T : Object

Parameters

assetRef AssetRef

asset reference

Returns

TAsyncOperation<IAssetHandle<T>>

A handle to that asset

Type Parameters

T

asset type

LoadCatalogInfoAsync(string)

load the catalog with that name

public static TAsyncOperation<IAssetCatalogInfo> LoadCatalogInfoAsync(string catalogName)

Parameters

catalogName string

catalog name

Returns

TAsyncOperation<IAssetCatalogInfo>

asset catalog info

LoadSceneAsync(string, LoadSceneMode)

Load the scene with that name

public static TAsyncOperation LoadSceneAsync(string sceneNameOrPath, LoadSceneMode loadSceneMode = LoadSceneMode.Single)

Parameters

sceneNameOrPath string

scene name

loadSceneMode LoadSceneMode

load scene mode

Returns

TAsyncOperation

LoadSceneAsync(LoadSceneInfo)

Load the scene with that LoadSceneInfo

public static TAsyncOperation LoadSceneAsync(LoadSceneInfo loadSceneInfo)

Parameters

loadSceneInfo LoadSceneInfo

LoadSceneInfo

Returns

TAsyncOperation

LoadSceneAsync(SceneAssetRef, LoadSceneMode)

Load the scene with the scene asset reference

public static TAsyncOperation LoadSceneAsync(SceneAssetRef sceneAssetRef, LoadSceneMode loadSceneMode = LoadSceneMode.Single)

Parameters

sceneAssetRef SceneAssetRef

scene asset reference

loadSceneMode LoadSceneMode

load scene mode

Returns

TAsyncOperation

SetRemoteUrl(string)

set remote url [BuildTarget] in url will be changed to UnityEditor.BuildTarget [AppVersion] in url will be changed to Application.version

public static void SetRemoteUrl(string remoteUrl)

Parameters

remoteUrl string

remote url

SetRemoteUrls(string[])

set remote urls

[Obsolete("AssetManager.SetRemoteUrls is deprecated. Use AssetManager.SetRemoteUrl instead.")]
public static void SetRemoteUrls(string[] remoteUrls)

Parameters

remoteUrls string[]

SetTagComparer(ITagComparer)

set tag comparer

public static void SetTagComparer(ITagComparer tagComparer)

Parameters

tagComparer ITagComparer

tag comparer

SetWebRequestBeforeSendCallback(WebRequestCallback)

Callback before sending web request

public static void SetWebRequestBeforeSendCallback(WebRequestCallback callback)

Parameters

callback WebRequestCallback

web request callback

SetWebRequestResultCallback(WebRequestCallback)

Result callback for web request

public static void SetWebRequestResultCallback(WebRequestCallback callback)

Parameters

callback WebRequestCallback

WebRequestCallback

UnloadAll()

Unload all assets. All AssetBundles are unloaded

public static void UnloadAll()

UnloadAsset(string)

Decreases the reference count of the asset in the path. When an AssetBundle containing an Asset is no longer referenced, it is automatically released.

public static bool UnloadAsset(string assetPath)

Parameters

assetPath string

asset path

Returns

bool

true if the asset is released false otherwise

UnloadAsset(AssetRef)

Decreases the reference count of the asset reference. When an AssetBundle containing an Asset is no longer referenced, it is automatically released.

public static bool UnloadAsset(AssetRef assetRef)

Parameters

assetRef AssetRef

asset reference

Returns

bool

true if the asset is released false otherwise

UnloadAsset(IAssetHandle)

Decreases the reference count of the asset handle. When an AssetBundle containing an Asset is no longer referenced, it is automatically released.

public static bool UnloadAsset(IAssetHandle assetHandle)

Parameters

assetHandle IAssetHandle

asset handle

Returns

bool

true if the asset is released false otherwise

UpdateCatalogAsync()

Update the default catalog

public static TAsyncOperation<bool> UpdateCatalogAsync()

Returns

TAsyncOperation<bool>

true if the catalog is updated false otherwise

UpdateCatalogAsync(string)

Update the catalog with that name

public static TAsyncOperation<bool> UpdateCatalogAsync(string catalogName)

Parameters

catalogName string

catalog name

Returns

TAsyncOperation<bool>

true if the catalog is updated false otherwise