For example to play the game when you have no internet so it can’t download all missing files?
Or even better can you change the bundle cache location to be the same as your game build folder so you can just ship all bundles with your game and update accordingly?
Ok so this seems possible. I don’t know if there could be any issues that arise from this but it does solve my problems.
Seeing as addressables is based on assetbundles you can change the asset cache in code to any folder you want.
I want my bundles to be in my game folder, I want everything to be remote and non-static so everything can be updated if I want.
With everything in my game build folder I can just launch it myself, download all the bundles once so it works from first launch and put that folder with downloaded bundles online.
I just changed the cache like this and addressables automatically use the new cache instead.
void Start() {
//Output the Game data path to the console
Debug.Log("dataPath : " + Application.dataPath);
//get the path to your game's executable
AddCacheAtPath(Application.dataPath+"/Bundles");
//download your remote asset bundles
StartCoroutine(DownloadYourAssets());
}
void AddCacheAtPath(string path) {
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
Cache newCache = Caching.AddCache(path);
//Make sure your new Cache is valid
if (newCache.valid) {
//If you wanted to set your newly created cache to the active cache
Caching.currentCacheForWriting = newCache;
}
}