Addressables
AssetBundle周りの使い方はなんもわかってない
概要についてはこの記事がめっちゃわかりやすい
https://qiita.com/yukiarrr/items/2e2b21530600ccf18f70
ResourceService
Provider
Location
Addressables
Locator
Diskから読んだりするときに使う方法
ResourceManagerだけでも使える
この記事が参考になる
https://light11.hatenadiary.com/entry/2020/05/06/154220#Resource-Manager
IResourceProviderを作って、Addする
使うときは、Locationを渡す
ProviderのProvideは参照数が0→1のときしか呼ばれない
ProviderのReleaseは参照数が1→0のときしか呼ばれない
VideoPlayerを使い回すやつを作ってみた
https://gist.github.com/shivaduke28/94f7bd1a7dcbbc94fa15ce819d24a3b4
参照数を見なくていいので便利
Addressables経由で使う場合
Locatorを作って、Addressablesに渡す
UnityEngine.AddressableAssets.ResourceLocators.ResourceLocationMap がLocatorの実装サンプルとしてよさげ
Providerは、Addressables.ResourceManagerに追加する
Addresablesは内部でLocatorをたくさん持っていて、LoadAsync<T>(string addres) が呼ばれると、Locatorの配列に対して、Locateメソッドを順番に読んで、最初にtrueを返したLocatorを使う、みたいな挙動で動く様子。
Catalogはなくても動くっぽい(Locatorが内部でカタログを持っている、とかにしておいて、外部から更新すれば、Locateできるかわかる、という話)
#Addressables