さけのさかなのブログ

同人ゲーム開発やってます。Unity使ったりする。

アセットバンドル備忘録

//キャッシュファイルのパス設定
var cachePath = System.IO.Path.Combine(Application.persistentDataPath, "cache");
System.IO.Directory.CreateDirectory(cachePath);
var cache = Caching.AddCache(cachePath);
Caching.currentCacheForWriting = cache;

// キャッシュの寿命設定
cache.expirationDelay = 200;


var c = new CachedAssetBundle()
{
        name = "key",
        hash = Hash128.Parse("hash128")
};
UnityEngine.Networking.UnityWebRequestAssetBundle.GetAssetBundle("url", c);