Loading bar async

Discussion and help for Easy Save 3
Post Reply
Alexandr Archer
Posts: 2
Joined: Wed Aug 14, 2019 8:37 am

Loading bar async

Post by Alexandr Archer »

I have this coroutine. Can I add ES3 loading progress to this? Or muliple progresses to all of my loading Lists?

private IEnumerator LoadWithBar (AsyncOperation loading)
{
loadBar.gameObject.SetActive(true);
while (!loading.isDone)
{
loadBar.LoadVisualise(loading.progress);
yield return null;
}
loadBar.gameObject.SetActive(false);
}
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Loading bar async

Post by Joel »

Hi there,

ES3.Save calls run synchronously, and there's no way of determining how long a save or load will take (the time taken to write data to disk very much depends on what else is happening across the operating system).

However, if you are using multiple Save calls, you might be able to indicate your own progress. For example, this might look like this:
private IEnumerator LoadWithBar ()
{
    loadBar.gameObject.SetActive(true);

    ES3.Save<int>("myInt', 123);
    loadBar.LoadVisualise(0.25f);
    yield return null;

    ES3.Save<int>("myInt', 123);
    loadBar.LoadVisualise(0.5f);
    yield return null;

    ES3.Save<int>("myInt', 123);
    loadBar.LoadVisualise(0.75f);
    yield return null;

    ES3.Save<int>("myInt', 123);
    loadBar.LoadVisualise(1.0f);

    loadBar.gameObject.SetActive(false);
}
Hope this helps!

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply