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
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
catalogNamestringcatalog 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
catalogNamestringcatalog 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
assetPathsstring[]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
assetRefsAssetRef[]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
sceneNameOrPathsstring[]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
sceneAssetRefsSceneAssetRef[]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
tagsstring[]tags
Returns
- TAsyncOperationProgress<AssetBundleDownloadInfo>
asset bundle download info
ExistAsset(string)
Whether the asset exists in the catalog
public static bool ExistAsset(string assetPath)
Parameters
assetPathstringasset 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
assetRefAssetRefasset 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
sceneNameOrPathstringscene 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
catalogNamestringcatalog 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
assetPathsstring[]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
assetRefsAssetRef[]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
sceneNameOrPathsstring[]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
sceneAssetRefsSceneAssetRef[]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
tagsstring[]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
IsLoadedAsset(string)
Is the asset for that path loaded?
public static bool IsLoadedAsset(string assetPath)
Parameters
assetPathstringasset 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
assetRefAssetRefasset 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
assetPathstringasset path
Returns
- TAsyncOperation<IAssetHandle<T>>
A handle to that asset
Type Parameters
Tasset type
LoadAssetAsync<T>(AssetRef)
Load asset by asset reference
public static TAsyncOperation<IAssetHandle<T>> LoadAssetAsync<T>(AssetRef assetRef) where T : Object
Parameters
assetRefAssetRefasset reference
Returns
- TAsyncOperation<IAssetHandle<T>>
A handle to that asset
Type Parameters
Tasset type
LoadCatalogInfoAsync(string)
load the catalog with that name
public static TAsyncOperation<IAssetCatalogInfo> LoadCatalogInfoAsync(string catalogName)
Parameters
catalogNamestringcatalog 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
sceneNameOrPathstringscene name
loadSceneModeLoadSceneModeload scene mode
Returns
LoadSceneAsync(LoadSceneInfo)
Load the scene with that LoadSceneInfo
public static TAsyncOperation LoadSceneAsync(LoadSceneInfo loadSceneInfo)
Parameters
loadSceneInfoLoadSceneInfoLoadSceneInfo
Returns
LoadSceneAsync(SceneAssetRef, LoadSceneMode)
Load the scene with the scene asset reference
public static TAsyncOperation LoadSceneAsync(SceneAssetRef sceneAssetRef, LoadSceneMode loadSceneMode = LoadSceneMode.Single)
Parameters
sceneAssetRefSceneAssetRefscene asset reference
loadSceneModeLoadSceneModeload scene mode
Returns
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
remoteUrlstringremote url
SetRemoteUrls(string[])
set remote urls
[Obsolete("AssetManager.SetRemoteUrls is deprecated. Use AssetManager.SetRemoteUrl instead.")]
public static void SetRemoteUrls(string[] remoteUrls)
Parameters
remoteUrlsstring[]
SetTagComparer(ITagComparer)
set tag comparer
public static void SetTagComparer(ITagComparer tagComparer)
Parameters
tagComparerITagComparertag comparer
SetWebRequestBeforeSendCallback(WebRequestCallback)
Callback before sending web request
public static void SetWebRequestBeforeSendCallback(WebRequestCallback callback)
Parameters
callbackWebRequestCallbackweb request callback
SetWebRequestResultCallback(WebRequestCallback)
Result callback for web request
public static void SetWebRequestResultCallback(WebRequestCallback callback)
Parameters
callbackWebRequestCallbackWebRequestCallback
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
assetPathstringasset 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
assetRefAssetRefasset 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
assetHandleIAssetHandleasset 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
catalogNamestringcatalog name
Returns
- TAsyncOperation<bool>
true if the catalog is updated false otherwise