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

Caching.ClearCachedVersion

Declaration

public static bool ClearCachedVersion(string assetBundleName, Hash128 hash);

Параметры

Параметр Описание
assetBundleName Имя AssetBundle.
хеш Версия нуждается в очистке.

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

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

Описание

Удаляет указанную версию AssetBundle.

using UnityEngine;

public class Example : MonoBehaviour { void ClearAssetBundleBundleFromCache(AssetBundle bundleToClear, string manifestBundlePath) { AssetBundle manifestBundle = AssetBundle.LoadFromFile(manifestBundlePath); AssetBundleManifest manifest = manifestBundle.LoadAsset<AssetBundleManifest>("AssetBundleManifest");

//This will clear the cached version from all caches, not just the currentCacheForWriting Caching.ClearCachedVersion(bundleToClear.name, manifest.GetAssetBundleHash(bundleToClear.name));

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