LoadFromAssetBundle
Namespace: SynicSugar.TitleStorage
public static async UniTask<T> LoadFromAssetBundle<T>(string filePath) where T : class
Description
Load file with Addressable.
When data exists in local, it is just loaded; if not, it is downloaded from Server and then loaded.
These Resource is managed in batches, and need to call ReleaseAddressables() on changing scene.
using SynicSugar.TitleStorage;
using UnityEngine;
using UnityEngine.UI;
public class TitleStorageSample : MonoBehaviour {
[SerializeField] Text currentProgress;
[SerializeField] Image logo;
async void Start() {
logo.sprite = await EOSTitleStorage.LoadFromAssetBundle<Sprite>("TestLogo");
}
void OnDestory() {
EOSTitleStorage.ReleaseAddressables();
}
}