PICO Platform Unity SDK
AssetFileService Class Reference

Static Public Member Functions

static Task< AssetFileDeleteResultDeleteById (ulong assetFileId)
 Deletes an installed asset file by asset file ID. The corresponding asset file will be removed from the device. More...
 
static Task< AssetFileDeleteResultDeleteByName (string assetFileName)
 Deletes an installed asset file by asset file name. The corresponding asset file will be removed from the device. More...
 
static Task< AssetFileDownloadResultDownloadById (ulong assetFileId)
 Downloads an asset file by asset file ID. More...
 
static Task< AssetFileDownloadResultDownloadByName (string assetFileName)
 Downloads an asset file by asset file name. More...
 
static Task< AssetFileDownloadCancelResultDownloadCancelById (ulong assetFileId)
 Cancels the download of an asset file by asset file ID. More...
 
static Task< AssetFileDownloadCancelResultDownloadCancelByName (string assetFileName)
 Cancels the download of an asset file by asset file name. More...
 
static Task< AssetStatusStatusById (ulong assetId)
 Gets the download status of an asset file by asset file ID. More...
 
static Task< AssetStatusStatusByName (string assetFileName)
 Gets the download status of an asset file by asset file name. More...
 
static Task< AssetDetailsListGetList ()
 Gets the asset file list.
More...
 
static Task< AssetDetailsListGetNextAssetDetailsListPage (AssetDetailsList list)
 Gets the next page of the asset file list. More...
 
static void SetOnDownloadUpdateCallback (Message< AssetFileDownloadUpdate >.Handler handler)
 This notification is used to track the download progress of asset file. The Transferred field indicates the number of bytes downloaded. The CompleteStatus field indicates the download status. More...
 
static void SetOnDeleteForSafetyCallback (Message< AssetFileDeleteForSafety >.Handler handler)
 If the downloaded asset file is different from the original one, the asset file will be automatically removed, and the app will receive a notification. More...
 

Detailed Description

Downloadable content (DLC) represents the contents/files such as expansion packs that users can purchase and download, which can help grow your revenue. Each DLC is associated with an add-on and has an individual SKU as its unique identifier. Users must purchase the app before purchasing the DLCs provided in it. DLCs are downloadable in apps only.

DLC enables you to update your app in a more flexible and lightweight way. Once you want to update the content for a published app, you only need to upload new resources such as levels and cosmetics as DLCs on the PICO Developer Platform, but do not need to upload a new build. Users can thereby purchase, download, and experience the latest resources without having to update or reinstall your app.

Member Function Documentation

◆ DeleteById()

static Task< AssetFileDeleteResult > DeleteById ( ulong  assetFileId)
inlinestatic

Deletes an installed asset file by asset file ID. The corresponding asset file will be removed from the device.

Parameters
assetFileIdThe ID of the asset file to delete.
Returns
An object containing the asset file ID, asset file name, and a success flag.

◆ DeleteByName()

static Task< AssetFileDeleteResult > DeleteByName ( string  assetFileName)
inlinestatic

Deletes an installed asset file by asset file name. The corresponding asset file will be removed from the device.

Parameters
assetFileNameThe name of the asset file to delete.
Returns
An object containing the asset file ID, asset file name, and a success flag.

◆ DownloadById()

static Task< AssetFileDownloadResult > DownloadById ( ulong  assetFileId)
inlinestatic

Downloads an asset file by asset file ID.

Parameters
assetFileIdThe ID of the asset file to download.
Returns

An object containing the asset file ID and asset file name.

If the response returns code 0, the download will start and the system will periodically push information about the download progress. If the user has not purchased the asset file, a non-zero error code will be returned.

◆ DownloadByName()

static Task< AssetFileDownloadResult > DownloadByName ( string  assetFileName)
inlinestatic

Downloads an asset file by asset file name.

Parameters
assetFileNameThe name of the asset file to download.
Returns

An object containing the asset file ID and asset file name.

If the response returns code 0, the download will start and the system will periodically push information about the download progress. If the user has not purchased the asset file, a non-zero error code will be returned.

◆ DownloadCancelById()

static Task< AssetFileDownloadCancelResult > DownloadCancelById ( ulong  assetFileId)
inlinestatic

Cancels the download of an asset file by asset file ID.

Parameters
assetFileIdThe ID of the asset file to cancel download for.
Returns
An object contains the asset file ID, asset file name, and a success flag.

◆ DownloadCancelByName()

static Task< AssetFileDownloadCancelResult > DownloadCancelByName ( string  assetFileName)
inlinestatic

Cancels the download of an asset file by asset file name.

Parameters
assetFileNameThe name of the asset file to cancel download for.
Returns
An object contains the asset file ID, asset file name, and a success flag.

◆ StatusById()

static Task< AssetStatus > StatusById ( ulong  assetId)
inlinestatic

Gets the download status of an asset file by asset file ID.

Parameters
assetIdThe ID of the asset file to get the download status for.
Returns
An object containing the asset file ID, asset file name, and whether the asset file is downloaded.

◆ StatusByName()

static Task< AssetStatus > StatusByName ( string  assetFileName)
inlinestatic

Gets the download status of an asset file by asset file name.

Parameters
assetFileNameThe name of the asset file to get the download status for.
Returns
An object containing the asset file ID, asset file name, and whether the asset file is downloaded.

◆ GetList()

static Task< AssetDetailsList > GetList ( )
inlinestatic

Gets the asset file list.

Returns
An asset file list. Each AssetDetails contains fields indicating whether an asset file is purchased or downloaded.

◆ GetNextAssetDetailsListPage()

static Task< AssetDetailsList > GetNextAssetDetailsListPage ( AssetDetailsList  list)
inlinestatic

Gets the next page of the asset file list.

Parameters
listThe current page of the asset file list.
Returns
The next page of the asset file list.

◆ SetOnDownloadUpdateCallback()

static void SetOnDownloadUpdateCallback ( Message< AssetFileDownloadUpdate >.Handler  handler)
inlinestatic

This notification is used to track the download progress of asset file. The Transferred field indicates the number of bytes downloaded. The CompleteStatus field indicates the download status.

Parameters
handlerThe callback function.

◆ SetOnDeleteForSafetyCallback()

static void SetOnDeleteForSafetyCallback ( Message< AssetFileDeleteForSafety >.Handler  handler)
inlinestatic

If the downloaded asset file is different from the original one, the asset file will be automatically removed, and the app will receive a notification.

Parameters
handlerThe callback function.