Unity 6.3
0 онлайн 83 гостей 3 в системе
Вход

Caching.ClearAllCachedVersions

Declaration

public static bool ClearAllCachedVersions(string assetBundleName);

Параметры

Параметр Описание
assetBundleName Имя AssetBundle.

Возвращаемое значение

логическое Возвращает true, если удаление кэша было успешно.

Описание

Удаляет все кэшируемые версии заданного AssetBundle из кэша.

Возвращает false, если используется какой-либо кэшированный пакет.

using System.Collections;
using UnityEngine.Networking;
using UnityEngine;

public class Example : MonoBehaviour { IEnumerator ClearAllCachedVersionsExample(string uri) { //Download the bundle UnityWebRequest request = UnityWebRequestAssetBundle.GetAssetBundle(uri); yield return request.SendWebRequest(); AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(request);

//Given the name of an asset bundle, this will clear every cached version across all caches Caching.ClearAllCachedVersions(bundle.name);

//Unload the AssetBundle bundle.Unload(true); } }