EOSTitleStorage
Namespace: SynicSugar.TitleStorage
Description
Download and load data from EOS title storage.
*This API is under test and I'm considering what the API should be. So, this will be changed in the future version.
*If you use this, (I use TitleStorage in this way now)
- Build a file(.bundle) as AssetBundle.
- Upload the AssetBundle to EPIC title storage with EncriptionKey in EOS plugin's Client Credentials.
- Build Game and delete 2 AssetBundle from APPNAME_Data/StreamingAssets/aa/PLATFORM/ASSETBUNDLENAME from build.
- call LoadFromAssetBundle(Uploaded Path) in runtime.
In the future, I will implement the proprietary code to build and read as Addressables.
Event
API | description |
---|---|
ProgressInfo | Event to display progress on GUI. |
Function
API | description |
---|---|
QueryFileList | Query the file List from backend |
FetchFile | When there is not target in local, Download it from EOS server |
FetchFiles | When there is not target in local, Download it from EOS server |
DeleteCache | Clear previously cached file data |
LoadFromAssetBundle | Load file with Addressable |
ReleaseAddressables | Destroy all used Addressable resources |
using SynicSugar.TitleStorage;
using UnityEngine;
using UnityEngine.UI;
public class TitleStorageSample : MonoBehaviour {
[SerializeField] Text currentProgress;
[SerializeField] Image logo;
async void Start() {
EOSTitleStorage.ProgressInfo.Register(DisplayCurrentProgress);
logo.sprite = await EOSTitleStorage.LoadFromAssetBundle<Sprite>("TestLogo");
}
void OnDestory() {
EOSTitleStorage.ProgressInfo.Clear();
EOSTitleStorage.ProgressInfo.ReleaseAddressables();
}
public void DisplayCurrentProgress(string currentFileName, float progress){
currentProgress.text = $"{currentFileName}: {progress}%";
}
}