Hi guys.
I have a question about cache control.
For my previous projects.
When I start the game, I download needed assetbundles and Cache.MarkAsUsed for already cached assetbudles.
And then, I simply call Caching.CleanCahe((int)Time.realtimeSinceStartup + Threshold).
This way, I was able to clean up all bundles that is currently not using.
So I want to implement similar functionality with Addressables too.
I found bundles from ResourceLocator keys (which ends with “.bundle”)
But I can’t call Cache.MarkAsUsed as it says it’s always not cached.
//foreach(var bundleName in bundleNames)
//{
// var fileName = System.IO.Path.GetFileNameWithoutExtension(bundleName);
// var splited = fileName.Split(‘_’);
// var hashString = splited[splited.Length - 1];
// var actualName = fileName.Remove(fileName.Length - (hashString.Length + 1), hashString.Length + 1);
// var bundle = new CachedAssetBundle(actualName, Hash128.Compute(hashString));
// Debug.Log($“Filename : {actualName} is {Caching.IsVersionCached(bundle)}”);
//}
I want to know which name Addressable uses as an actual bundle name.
So I can create CachedAssetBundle to MarkAsUsed.
PS. I see ClearDependencyCacheAsync function in addressables,
How’s adding MarkDependencyCacheUsedAsync??
Thank you!