This PR allow GTFO-API to load bundles asynchronously and also adding loading screen to show players to what assets being loaded ATM
It would have some time-saving on loading multiple bundles even the unity's async asset loading is not fully working parallelly. (by saving little time loading file itself or listing assets)
Plus, this PR open new API in AssetAPI to plugin developers to load their stuff during loading screen asynchronously and print out process while loading
AssetAPI.OnCustomAssetsLoading += LoadAudios;
void LoadAudios()
{
foreach (var file in files)
{
AssetAPI.WantToWorkForStartupAssets(out AssetLoadHandle loadingHandle);
Task.Run(LoadAudioAsync(file, in loadingHandle));
}
}
async Task LoadAudio(string file, in AssetLoadHandle loadingHandle)
{
loadingHandle.AddLoadingText($"Start Loading Audio: {file}");
//await Do Loading
loadingHandle.AddLoadingText($"Loaded Audio: {file}");
loadingHandle.SetCompleted();
}
This PR allow GTFO-API to load bundles asynchronously and also adding loading screen to show players to what assets being loaded ATM
It would have some time-saving on loading multiple bundles even the unity's async asset loading is not fully working parallelly. (by saving little time loading file itself or listing assets)
Plus, this PR open new API in AssetAPI to plugin developers to load their stuff during loading screen asynchronously and print out process while loading